Skip to content

Commit

Permalink
docs(samples): include metadata file, add exclusions for samples to h…
Browse files Browse the repository at this point in the history
…andwritten libraries (#69)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9
  • Loading branch information
gcf-owl-bot[bot] authored Feb 18, 2022
1 parent c1ea078 commit 797984e
Show file tree
Hide file tree
Showing 6 changed files with 211 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"clientLibrary": {
"name": "nodejs-privatecatalog",
"version": "0.1.0",
"language": "TYPESCRIPT",
"apis": [
{
"id": "google.cloud.privatecatalog.v1beta1",
"version": "v1beta1"
}
]
},
"snippets": [
{
"regionTag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_async",
"title": "PrivateCatalog searchCatalogs Sample",
"origin": "API_DEFINITION",
"description": " Search [Catalog][google.cloud.privatecatalog.v1beta1.Catalog] resources that consumers have access to, within the scope of the consumer cloud resource hierarchy context.",
"canonical": true,
"file": "private_catalog.search_catalogs.js",
"language": "JAVASCRIPT",
"segments": [
{
"start": 25,
"end": 69,
"type": "FULL"
}
],
"clientMethod": {
"shortName": "SearchCatalogs",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs",
"async": true,
"parameters": [
{
"name": "resource",
"type": "TYPE_STRING"
},
{
"name": "query",
"type": "TYPE_STRING"
},
{
"name": "page_size",
"type": "TYPE_INT32"
},
{
"name": "page_token",
"type": "TYPE_STRING"
}
],
"resultType": ".google.cloud.privatecatalog.v1beta1.SearchCatalogsResponse",
"client": {
"shortName": "PrivateCatalogClient",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalogClient"
},
"method": {
"shortName": "SearchCatalogs",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchCatalogs",
"service": {
"shortName": "PrivateCatalog",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog"
}
}
}
},
{
"regionTag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_async",
"title": "PrivateCatalog searchProducts Sample",
"origin": "API_DEFINITION",
"description": " Search [Product][google.cloud.privatecatalog.v1beta1.Product] resources that consumers have access to, within the scope of the consumer cloud resource hierarchy context.",
"canonical": true,
"file": "private_catalog.search_products.js",
"language": "JAVASCRIPT",
"segments": [
{
"start": 25,
"end": 71,
"type": "FULL"
}
],
"clientMethod": {
"shortName": "SearchProducts",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts",
"async": true,
"parameters": [
{
"name": "resource",
"type": "TYPE_STRING"
},
{
"name": "query",
"type": "TYPE_STRING"
},
{
"name": "page_size",
"type": "TYPE_INT32"
},
{
"name": "page_token",
"type": "TYPE_STRING"
}
],
"resultType": ".google.cloud.privatecatalog.v1beta1.SearchProductsResponse",
"client": {
"shortName": "PrivateCatalogClient",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalogClient"
},
"method": {
"shortName": "SearchProducts",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchProducts",
"service": {
"shortName": "PrivateCatalog",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog"
}
}
}
},
{
"regionTag": "cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_async",
"title": "PrivateCatalog searchVersions Sample",
"origin": "API_DEFINITION",
"description": " Search [Version][google.cloud.privatecatalog.v1beta1.Version] resources that consumers have access to, within the scope of the consumer cloud resource hierarchy context.",
"canonical": true,
"file": "private_catalog.search_versions.js",
"language": "JAVASCRIPT",
"segments": [
{
"start": 25,
"end": 72,
"type": "FULL"
}
],
"clientMethod": {
"shortName": "SearchVersions",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions",
"async": true,
"parameters": [
{
"name": "resource",
"type": "TYPE_STRING"
},
{
"name": "query",
"type": "TYPE_STRING"
},
{
"name": "page_size",
"type": "TYPE_INT32"
},
{
"name": "page_token",
"type": "TYPE_STRING"
}
],
"resultType": ".google.cloud.privatecatalog.v1beta1.SearchVersionsResponse",
"client": {
"shortName": "PrivateCatalogClient",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalogClient"
},
"method": {
"shortName": "SearchVersions",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog.SearchVersions",
"service": {
"shortName": "PrivateCatalog",
"fullName": "google.cloud.privatecatalog.v1beta1.PrivateCatalog"
}
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,8 @@ export class PrivateCatalogClient {
* @returns {Promise} A promise that resolves when the client is closed.
*/
close(): Promise<void> {
this.initialize();
if (!this._terminated) {
return this.privateCatalogStub!.then(stub => {
if (this.privateCatalogStub && !this._terminated) {
return this.privateCatalogStub.then(stub => {
this._terminated = true;
stub.close();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,27 @@ describe('v1beta1.PrivateCatalogClient', () => {
assert(client.privateCatalogStub);
});

it('has close method', () => {
it('has close method for the initialized client', done => {
const client = new privatecatalogModule.v1beta1.PrivateCatalogClient({
credentials: {client_email: 'bogus', private_key: 'bogus'},
projectId: 'bogus',
});
client.close();
client.initialize();
assert(client.privateCatalogStub);
client.close().then(() => {
done();
});
});

it('has close method for the non-initialized client', done => {
const client = new privatecatalogModule.v1beta1.PrivateCatalogClient({
credentials: {client_email: 'bogus', private_key: 'bogus'},
projectId: 'bogus',
});
assert.strictEqual(client.privateCatalogStub, undefined);
client.close().then(() => {
done();
});
});

it('has getProjectId method', async () => {
Expand Down

0 comments on commit 797984e

Please sign in to comment.