diff --git a/librarian.yaml b/librarian.yaml index d69337fe7255..63ce83601021 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1762,12 +1762,18 @@ libraries: - path: google/devtools/containeranalysis/v1 - path: google/devtools/containeranalysis/v1beta1 copyright_year: "2026" - skip_generate: true nodejs: default_version: v1 dependencies: '@google-cloud/grafeas': ^6.0.0 main_service: containeranalysis + nodejs_apis: + - additional_protos: + - grafeas/v1/grafeas.proto + path: google/devtools/containeranalysis/v1 + - additional_protos: + - google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + path: google/devtools/containeranalysis/v1beta1 package_name: '@google-cloud/containeranalysis' - name: google-iam version: 2.4.0 diff --git a/packages/google-devtools-containeranalysis/.OwlBot.yaml b/packages/google-devtools-containeranalysis/.OwlBot.yaml deleted file mode 100644 index b4e658ee88bd..000000000000 --- a/packages/google-devtools-containeranalysis/.OwlBot.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2021 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 -# -# 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. - -deep-remove-regex: - - /owl-bot-staging -deep-copy-regex: - - source: /google/devtools/containeranalysis/google-devtools-containeranalysis-nodejs - dest: /owl-bot-staging/google-devtools-containeranalysis -begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b -api-name: containeranalysis diff --git a/packages/google-devtools-containeranalysis/.repo-metadata.json b/packages/google-devtools-containeranalysis/.repo-metadata.json index 52c3192317a1..86a49eb59d45 100644 --- a/packages/google-devtools-containeranalysis/.repo-metadata.json +++ b/packages/google-devtools-containeranalysis/.repo-metadata.json @@ -1,17 +1,16 @@ { + "api_description": "This API is a prerequisite for leveraging Artifact Analysis\nscanning capabilities in both Artifact Registry and with Advanced\nVulnerability Insights (runtime scanning) in GKE.\n\nIn addition, the Container Analysis API is an implementation of the\nGrafeas API, which enables storing, querying, and retrieval of critical\nmetadata\nabout all of your software artifacts.", "api_id": "containeranalysis.googleapis.com", "api_shortname": "containeranalysis", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/containeranalysis/latest", - "codeowner_team": "@googleapis/aap-dpes", "default_version": "v1", "distribution_name": "@google-cloud/containeranalysis", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559742", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559777", "language": "nodejs", "library_type": "GAPIC_AUTO", "name": "containeranalysis", - "name_pretty": "Google Container Analysis", - "product_documentation": "https://cloud.google.com/container-registry/docs/container-analysis", + "name_pretty": "Container Analysis", + "product_documentation": "https://cloud.google.com/container-registry/docs", "release_level": "stable", - "repo": "googleapis/google-cloud-node", - "requires_billing": true + "repo": "googleapis/google-cloud-node" } \ No newline at end of file diff --git a/packages/google-devtools-containeranalysis/librarian.js b/packages/google-devtools-containeranalysis/librarian.js index b91c7a5ca7da..b75b7b229322 100644 --- a/packages/google-devtools-containeranalysis/librarian.js +++ b/packages/google-devtools-containeranalysis/librarian.js @@ -123,14 +123,34 @@ filesToDelete.forEach(file => { } }); -// Add beta version GrafeasClient to export +const v1SamplesDir = path.resolve('packages/google-devtools-containeranalysis/samples/generated/v1'); +if (fs.existsSync(v1SamplesDir)) { + const v1SamplesToDelete = findFilesByExtension(v1SamplesDir, '.js', /^grafeas\./); + v1SamplesToDelete.forEach(file => { + try { + fs.unlinkSync(file); + console.log(`Successfully deleted sample: ${file}`); + } catch (err) { + console.error(`Error deleting sample ${file}:`, err); + } + }); +} + +// Remove GrafeasClient from top-level export const indexFile = path.resolve('packages/google-devtools-containeranalysis/src/index.ts'); -const searchPattern1 = /const GrafeasClient = v1\.GrafeasClient;\ntype GrafeasClient = v1\.GrafeasClient;/g; -const replacement1 = '\nconst GrafeasClient = v1beta1.GrafeasV1Beta1Client;\n' + - 'type GrafeasClient = v1beta1.GrafeasV1Beta1Client;'; -replaceInFile(indexFile, searchPattern1, replacement1); +replaceInFile(indexFile, /const GrafeasClient = v1\.GrafeasClient;\s*type GrafeasClient = v1\.GrafeasClient;/g, ''); +replaceInFile(indexFile, /,\s*GrafeasClient/g, ''); + +// Fix system-test fixture samples to remove GrafeasClient references +const sampleTsFile = path.resolve('packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.ts'); +replaceInFile(sampleTsFile, /\n\s*GrafeasClient,/g, ''); +replaceInFile(sampleTsFile, /\nfunction doStuffWithGrafeasClient\([\s\S]*?\}\n/g, '\n'); +replaceInFile(sampleTsFile, /\n\s*\/\/ check that the client instance can be created\n\s*const grafeasClient = new GrafeasClient\(\);\n\s*doStuffWithGrafeasClient\(grafeasClient\);/g, ''); + +const sampleJsFile = path.resolve('packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.js'); +replaceInFile(sampleJsFile, /\n\s*const grafeasClient = new containeranalysis\.GrafeasClient\(\);/g, ''); const v1IndexFile = path.resolve('packages/google-devtools-containeranalysis/src/v1/index.ts'); -const searchPattern2 = /export {GrafeasClient} from '\.\/grafeas_client';/g; +const searchPattern2 = /export\s+{\s*GrafeasClient\s*}\s*from\s*'\.\/grafeas_client';/g; const replacement2 = '\n'; replaceInFile(v1IndexFile, searchPattern2, replacement2); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_notes.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_notes.js deleted file mode 100644 index 0170c7470792..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_notes.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, notes) { - // [START containeranalysis_v1_generated_Grafeas_BatchCreateNotes_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the notes are to be created. - */ - // const parent = 'abc123' - /** - * The notes to create. Max allowed length is 1000. - */ - // const notes = [1,2,3,4] - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callBatchCreateNotes() { - // Construct request - const request = { - parent, - notes, - }; - - // Run request - const response = await containeranalysisClient.batchCreateNotes(request); - console.log(response); - } - - callBatchCreateNotes(); - // [END containeranalysis_v1_generated_Grafeas_BatchCreateNotes_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_occurrences.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_occurrences.js deleted file mode 100644 index d5c32a89a988..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_occurrences.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, occurrences) { - // [START containeranalysis_v1_generated_Grafeas_BatchCreateOccurrences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the occurrences are to be created. - */ - // const parent = 'abc123' - /** - * The occurrences to create. Max allowed length is 1000. - */ - // const occurrences = [1,2,3,4] - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callBatchCreateOccurrences() { - // Construct request - const request = { - parent, - occurrences, - }; - - // Run request - const response = await containeranalysisClient.batchCreateOccurrences(request); - console.log(response); - } - - callBatchCreateOccurrences(); - // [END containeranalysis_v1_generated_Grafeas_BatchCreateOccurrences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_note.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_note.js deleted file mode 100644 index 848f9349f516..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_note.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, noteId, note) { - // [START containeranalysis_v1_generated_Grafeas_CreateNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the note is to be created. - */ - // const parent = 'abc123' - /** - * The ID to use for this note. - */ - // const noteId = 'abc123' - /** - * The note to create. - */ - // const note = {} - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callCreateNote() { - // Construct request - const request = { - parent, - noteId, - note, - }; - - // Run request - const response = await containeranalysisClient.createNote(request); - console.log(response); - } - - callCreateNote(); - // [END containeranalysis_v1_generated_Grafeas_CreateNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_occurrence.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_occurrence.js deleted file mode 100644 index 6838c28c5158..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_occurrence.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, occurrence) { - // [START containeranalysis_v1_generated_Grafeas_CreateOccurrence_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project in the form of `projects/[PROJECT_ID]`, under which - * the occurrence is to be created. - */ - // const parent = 'abc123' - /** - * The occurrence to create. - */ - // const occurrence = {} - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callCreateOccurrence() { - // Construct request - const request = { - parent, - occurrence, - }; - - // Run request - const response = await containeranalysisClient.createOccurrence(request); - console.log(response); - } - - callCreateOccurrence(); - // [END containeranalysis_v1_generated_Grafeas_CreateOccurrence_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_note.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_note.js deleted file mode 100644 index d749a714d42d..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_note.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_DeleteNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - */ - // const name = 'abc123' - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callDeleteNote() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await containeranalysisClient.deleteNote(request); - console.log(response); - } - - callDeleteNote(); - // [END containeranalysis_v1_generated_Grafeas_DeleteNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_occurrence.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_occurrence.js deleted file mode 100644 index c0ba309129bb..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_occurrence.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_DeleteOccurrence_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - */ - // const name = 'abc123' - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callDeleteOccurrence() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await containeranalysisClient.deleteOccurrence(request); - console.log(response); - } - - callDeleteOccurrence(); - // [END containeranalysis_v1_generated_Grafeas_DeleteOccurrence_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_note.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_note.js deleted file mode 100644 index 62ba1cff77a6..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_note.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_GetNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - */ - // const name = 'abc123' - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callGetNote() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await containeranalysisClient.getNote(request); - console.log(response); - } - - callGetNote(); - // [END containeranalysis_v1_generated_Grafeas_GetNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence.js deleted file mode 100644 index 27dd5edbb55a..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_GetOccurrence_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - */ - // const name = 'abc123' - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callGetOccurrence() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await containeranalysisClient.getOccurrence(request); - console.log(response); - } - - callGetOccurrence(); - // [END containeranalysis_v1_generated_Grafeas_GetOccurrence_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence_note.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence_note.js deleted file mode 100644 index 173369feaf10..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence_note.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_GetOccurrenceNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - */ - // const name = 'abc123' - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callGetOccurrenceNote() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await containeranalysisClient.getOccurrenceNote(request); - console.log(response); - } - - callGetOccurrenceNote(); - // [END containeranalysis_v1_generated_Grafeas_GetOccurrenceNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_note_occurrences.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_note_occurrences.js deleted file mode 100644 index 8e6bd259f774..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_note_occurrences.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START containeranalysis_v1_generated_Grafeas_ListNoteOccurrences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the note to list occurrences for in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - */ - // const name = 'abc123' - /** - * The filter expression. - */ - // const filter = 'abc123' - /** - * Number of occurrences to return in the list. - */ - // const pageSize = 1234 - /** - * Token to provide to skip to a particular spot in the list. - */ - // const pageToken = 'abc123' - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callListNoteOccurrences() { - // Construct request - const request = { - name, - }; - - // Run request - const iterable = containeranalysisClient.listNoteOccurrencesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListNoteOccurrences(); - // [END containeranalysis_v1_generated_Grafeas_ListNoteOccurrences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_notes.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_notes.js deleted file mode 100644 index f6d0e46fd2f1..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_notes.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START containeranalysis_v1_generated_Grafeas_ListNotes_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project to list notes for in the form of - * `projects/[PROJECT_ID]`. - */ - // const parent = 'abc123' - /** - * The filter expression. - */ - // const filter = 'abc123' - /** - * Number of notes to return in the list. Must be positive. Max allowed page - * size is 1000. If not specified, page size defaults to 20. - */ - // const pageSize = 1234 - /** - * Token to provide to skip to a particular spot in the list. - */ - // const pageToken = 'abc123' - /** - * If set, the request will return all reachable Notes - * and report all unreachable regions in the `unreachable` field in - * the response. - * Only applicable for requests in the global region. - */ - // const returnPartialSuccess = true - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callListNotes() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = containeranalysisClient.listNotesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListNotes(); - // [END containeranalysis_v1_generated_Grafeas_ListNotes_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_occurrences.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_occurrences.js deleted file mode 100644 index 71bb35bef5dd..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_occurrences.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START containeranalysis_v1_generated_Grafeas_ListOccurrences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the project to list occurrences for in the form of - * `projects/[PROJECT_ID]`. - */ - // const parent = 'abc123' - /** - * The filter expression. - */ - // const filter = 'abc123' - /** - * Number of occurrences to return in the list. Must be positive. Max allowed - * page size is 1000. If not specified, page size defaults to 20. - */ - // const pageSize = 1234 - /** - * Token to provide to skip to a particular spot in the list. - */ - // const pageToken = 'abc123' - /** - * If set, the request will return all reachable Occurrences - * and report all unreachable regions in the `unreachable` field in - * the response. - * Only applicable for requests in the global region. - */ - // const returnPartialSuccess = true - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callListOccurrences() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = containeranalysisClient.listOccurrencesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListOccurrences(); - // [END containeranalysis_v1_generated_Grafeas_ListOccurrences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_note.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_note.js deleted file mode 100644 index ef8d2db6b29a..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_note.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, note) { - // [START containeranalysis_v1_generated_Grafeas_UpdateNote_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the note in the form of - * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. - */ - // const name = 'abc123' - /** - * The updated note. - */ - // const note = {} - /** - * The fields to update. - */ - // const updateMask = {} - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callUpdateNote() { - // Construct request - const request = { - name, - note, - }; - - // Run request - const response = await containeranalysisClient.updateNote(request); - console.log(response); - } - - callUpdateNote(); - // [END containeranalysis_v1_generated_Grafeas_UpdateNote_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_occurrence.js b/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_occurrence.js deleted file mode 100644 index 81fbaba4162a..000000000000 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_occurrence.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, occurrence) { - // [START containeranalysis_v1_generated_Grafeas_UpdateOccurrence_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The name of the occurrence in the form of - * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. - */ - // const name = 'abc123' - /** - * The updated occurrence. - */ - // const occurrence = {} - /** - * The fields to update. - */ - // const updateMask = {} - - // Imports the Containeranalysis library - const {GrafeasClient} = require('@google-cloud/containeranalysis').v1; - - // Instantiates a client - const containeranalysisClient = new GrafeasClient(); - - async function callUpdateOccurrence() { - // Construct request - const request = { - name, - occurrence, - }; - - // Run request - const response = await containeranalysisClient.updateOccurrence(request); - console.log(response); - } - - callUpdateOccurrence(); - // [END containeranalysis_v1_generated_Grafeas_UpdateOccurrence_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-devtools-containeranalysis/src/index.ts b/packages/google-devtools-containeranalysis/src/index.ts index 0db6884c961e..14b0c5c4be03 100644 --- a/packages/google-devtools-containeranalysis/src/index.ts +++ b/packages/google-devtools-containeranalysis/src/index.ts @@ -22,6 +22,7 @@ import * as v1beta1 from './v1beta1'; const ContainerAnalysisClient = v1.ContainerAnalysisClient; type ContainerAnalysisClient = v1.ContainerAnalysisClient; + export {v1, v1beta1, ContainerAnalysisClient}; export default {v1, v1beta1, ContainerAnalysisClient}; import * as protos from '../protos/protos'; diff --git a/packages/google-devtools-containeranalysis/src/v1/index.ts b/packages/google-devtools-containeranalysis/src/v1/index.ts index f968fd03b02f..ee1dd37dc296 100644 --- a/packages/google-devtools-containeranalysis/src/v1/index.ts +++ b/packages/google-devtools-containeranalysis/src/v1/index.ts @@ -16,4 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export {ContainerAnalysisClient} from './container_analysis_client'; +export { ContainerAnalysisClient } from './container_analysis_client'; + + diff --git a/packages/google-devtools-containeranalysis/src/v1beta1/index.ts b/packages/google-devtools-containeranalysis/src/v1beta1/index.ts index 3b46c5e211f9..11a4c78e3c6a 100644 --- a/packages/google-devtools-containeranalysis/src/v1beta1/index.ts +++ b/packages/google-devtools-containeranalysis/src/v1beta1/index.ts @@ -16,5 +16,5 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export {ContainerAnalysisV1Beta1Client} from './container_analysis_v1_beta1_client'; -export {GrafeasV1Beta1Client} from './grafeas_v1_beta1_client'; +export { ContainerAnalysisV1Beta1Client } from './container_analysis_v1_beta1_client'; +export { GrafeasV1Beta1Client } from './grafeas_v1_beta1_client'; diff --git a/packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.js b/packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.js index 7254d67cd813..574593fefb6b 100644 --- a/packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.js +++ b/packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.js @@ -16,12 +16,12 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** + /* eslint-disable node/no-missing-require, no-unused-vars */ const containeranalysis = require('@google-cloud/containeranalysis'); function main() { - const containerAnalysisClient = - new containeranalysis.ContainerAnalysisClient(); + const containerAnalysisClient = new containeranalysis.ContainerAnalysisClient(); } main(); diff --git a/packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.ts b/packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.ts index c8d73b422512..32b2a43a3e2f 100644 --- a/packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.ts +++ b/packages/google-devtools-containeranalysis/system-test/fixtures/sample/src/index.ts @@ -16,7 +16,9 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {ContainerAnalysisClient} from '@google-cloud/containeranalysis'; +import { + ContainerAnalysisClient, +} from '@google-cloud/containeranalysis'; // check that the client class type name can be used function doStuffWithContainerAnalysisClient(client: ContainerAnalysisClient) {