From 60a81ee0e6716f1bf76f2ea20796d519283c852c Mon Sep 17 00:00:00 2001 From: Nirupa Anantha Kumar Date: Thu, 29 Nov 2018 11:04:41 -0800 Subject: [PATCH] ProductSearch GA (#280) * ProductSearch GA * ProductSearch GA --- ...ProductSets.v1p3beta1.js => importProductSets.js} | 2 +- .../{productSearch.v1p3beta1.js => productSearch.js} | 6 +++--- .../{productSets.v1p3beta1.js => productSets.js} | 8 ++++---- .../{products.v1p3beta1.js => products.js} | 10 +++++----- ...ferenceImages.v1p3beta1.js => referenceImages.js} | 12 ++++++------ ...milarProducts.v1p3beta1.js => similarProducts.js} | 4 ++-- ...s.v1p3beta1.test.js => importProductSets.test.js} | 2 +- ...earch.v1p3beta1.test.js => productSearch.test.js} | 4 ++-- ...uctSets.v1p3beta1.test.js => productSets.test.js} | 4 ++-- .../{products.v1p3beta1.test.js => products.test.js} | 4 ++-- ...ges.v1p3beta1.test.js => referenceImages.test.js} | 4 ++-- ...cts.v1p3beta1.test.js => similarProducts.test.js} | 6 +++--- 12 files changed, 33 insertions(+), 33 deletions(-) rename samples/productSearch/{importProductSets.v1p3beta1.js => importProductSets.js} (97%) rename samples/productSearch/{productSearch.v1p3beta1.js => productSearch.js} (95%) rename samples/productSearch/{productSets.v1p3beta1.js => productSets.js} (95%) rename samples/productSearch/{products.v1p3beta1.js => products.js} (96%) rename samples/productSearch/{referenceImages.v1p3beta1.js => referenceImages.js} (94%) rename samples/productSearch/{similarProducts.v1p3beta1.js => similarProducts.js} (97%) rename samples/system-test/{importProductSets.v1p3beta1.test.js => importProductSets.test.js} (96%) rename samples/system-test/{productSearch.v1p3beta1.test.js => productSearch.test.js} (97%) rename samples/system-test/{productSets.v1p3beta1.test.js => productSets.test.js} (97%) rename samples/system-test/{products.v1p3beta1.test.js => products.test.js} (98%) rename samples/system-test/{referenceImages.v1p3beta1.test.js => referenceImages.test.js} (96%) rename samples/system-test/{similarProducts.v1p3beta1.test.js => similarProducts.test.js} (96%) diff --git a/samples/productSearch/importProductSets.v1p3beta1.js b/samples/productSearch/importProductSets.js similarity index 97% rename from samples/productSearch/importProductSets.v1p3beta1.js rename to samples/productSearch/importProductSets.js index 5e716505..74aabafa 100644 --- a/samples/productSearch/importProductSets.v1p3beta1.js +++ b/samples/productSearch/importProductSets.js @@ -18,7 +18,7 @@ async function importProductSets(projectId, location, gcsUri) { // Imports the Google Cloud client library // [START vision_product_search_tutorial_import] - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // [END vision_product_search_tutorial_import] // Creates a client const client = new vision.ProductSearchClient(); diff --git a/samples/productSearch/productSearch.v1p3beta1.js b/samples/productSearch/productSearch.js similarity index 95% rename from samples/productSearch/productSearch.v1p3beta1.js rename to samples/productSearch/productSearch.js index 2e05d7f6..9bf7d04f 100644 --- a/samples/productSearch/productSearch.v1p3beta1.js +++ b/samples/productSearch/productSearch.js @@ -23,7 +23,7 @@ async function addProductToProductSet( ) { // [START vision_product_search_add_product_to_product_set] - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); const client = new vision.ProductSearchClient(); @@ -55,7 +55,7 @@ async function addProductToProductSet( async function listProductsInProductSet(projectId, location, productSetId) { // [START vision_product_search_list_products_in_product_set] - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); const client = new vision.ProductSearchClient(); @@ -90,7 +90,7 @@ async function removeProductFromProductSet( ) { // [START vision_product_search_remove_product_from_product_set] - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); const client = new vision.ProductSearchClient(); diff --git a/samples/productSearch/productSets.v1p3beta1.js b/samples/productSearch/productSets.js similarity index 95% rename from samples/productSearch/productSets.v1p3beta1.js rename to samples/productSearch/productSets.js index 4ff17845..a9d6efda 100644 --- a/samples/productSearch/productSets.v1p3beta1.js +++ b/samples/productSearch/productSets.js @@ -23,7 +23,7 @@ async function createProductSet( ) { // [START vision_product_search_create_product_set] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); @@ -57,7 +57,7 @@ async function createProductSet( async function getProductSet(projectId, location, productSetId) { // [START vision_product_search_get_product_set] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); @@ -85,7 +85,7 @@ async function getProductSet(projectId, location, productSetId) { async function listProductSets(projectId, location) { // [START vision_product_search_list_product_sets] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); @@ -110,7 +110,7 @@ async function listProductSets(projectId, location) { async function deleteProductSet(projectId, location, productSetId) { // [START vision_product_search_delete_product_set] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); diff --git a/samples/productSearch/products.v1p3beta1.js b/samples/productSearch/products.js similarity index 96% rename from samples/productSearch/products.v1p3beta1.js rename to samples/productSearch/products.js index 65aafd32..5cf1e841 100644 --- a/samples/productSearch/products.v1p3beta1.js +++ b/samples/productSearch/products.js @@ -24,7 +24,7 @@ async function createProduct( ) { // [START vision_product_search_create_product] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); @@ -60,7 +60,7 @@ async function createProduct( async function getProduct(projectId, location, productId) { // [START vision_product_search_get_product] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); @@ -88,7 +88,7 @@ async function getProduct(projectId, location, productId) { async function listProducts(projectId, location) { // [START vision_product_search_list_products] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); @@ -122,7 +122,7 @@ async function listProducts(projectId, location) { async function deleteProduct(projectId, location, productId) { // [START vision_product_search_delete_product] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); @@ -145,7 +145,7 @@ async function deleteProduct(projectId, location, productId) { async function updateProductLabels(projectId, location, productId, key, value) { // [START vision_product_search_update_product_labels] // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const client = new vision.ProductSearchClient(); diff --git a/samples/productSearch/referenceImages.v1p3beta1.js b/samples/productSearch/referenceImages.js similarity index 94% rename from samples/productSearch/referenceImages.v1p3beta1.js rename to samples/productSearch/referenceImages.js index 72008093..80863d20 100644 --- a/samples/productSearch/referenceImages.v1p3beta1.js +++ b/samples/productSearch/referenceImages.js @@ -24,7 +24,7 @@ async function createReferenceImage( ) { // [START vision_product_search_create_reference_image] - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); const client = new vision.ProductSearchClient(); @@ -58,7 +58,7 @@ async function createReferenceImage( async function listReferenceImage(projectId, location, productId) { // [START vision_product_search_list_reference_images] - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); const client = new vision.ProductSearchClient(); @@ -91,7 +91,7 @@ async function getReferenceImage( ) { // [START vision_product_search_get_reference_image] - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); const client = new vision.ProductSearchClient(); @@ -103,7 +103,7 @@ async function getReferenceImage( // const productId = 'Id of the product'; // const referenceImageId = 'Id of the reference image'; - const formattedName = client.referenceImagePath( + const formattedName = client.imagePath( projectId, location, productId, @@ -128,7 +128,7 @@ async function deleteReferenceImage( ) { // [START vision_product_search_delete_reference_image] - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); const client = new vision.ProductSearchClient(); @@ -140,7 +140,7 @@ async function deleteReferenceImage( // const productId = 'Id of the product'; // const referenceImageId = 'Id of the reference image'; - const formattedName = client.referenceImagePath( + const formattedName = client.imagePath( projectId, location, productId, diff --git a/samples/productSearch/similarProducts.v1p3beta1.js b/samples/productSearch/similarProducts.js similarity index 97% rename from samples/productSearch/similarProducts.v1p3beta1.js rename to samples/productSearch/similarProducts.js index 6dc0c645..967c452d 100644 --- a/samples/productSearch/similarProducts.v1p3beta1.js +++ b/samples/productSearch/similarProducts.js @@ -24,7 +24,7 @@ async function getSimilarProductsFile( filter ) { // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); const fs = require('fs'); // Creates a client const productSearchClient = new vision.ProductSearchClient(); @@ -87,7 +87,7 @@ async function getSimilarProductsGcs( filter ) { // Imports the Google Cloud client library - const vision = require('@google-cloud/vision').v1p3beta1; + const vision = require('@google-cloud/vision'); // Creates a client const productSearchClient = new vision.ProductSearchClient(); const imageAnnotatorClient = new vision.ImageAnnotatorClient(); diff --git a/samples/system-test/importProductSets.v1p3beta1.test.js b/samples/system-test/importProductSets.test.js similarity index 96% rename from samples/system-test/importProductSets.v1p3beta1.test.js rename to samples/system-test/importProductSets.test.js index acdc6652..67fc1e00 100644 --- a/samples/system-test/importProductSets.v1p3beta1.test.js +++ b/samples/system-test/importProductSets.test.js @@ -18,7 +18,7 @@ const path = require(`path`); const assert = require('assert'); const tools = require(`@google-cloud/nodejs-repo-tools`); -const cmd = `node importProductSets.v1p3beta1.js`; +const cmd = `node importProductSets.js`; const cwd = path.join(__dirname, `..`, `productSearch`); //Shared fixture data for product tests diff --git a/samples/system-test/productSearch.v1p3beta1.test.js b/samples/system-test/productSearch.test.js similarity index 97% rename from samples/system-test/productSearch.v1p3beta1.test.js rename to samples/system-test/productSearch.test.js index be8a4f93..40e373e0 100644 --- a/samples/system-test/productSearch.v1p3beta1.test.js +++ b/samples/system-test/productSearch.test.js @@ -17,11 +17,11 @@ const path = require(`path`); const uuid = require(`uuid`); -const vision = require('@google-cloud/vision').v1p3beta1; +const vision = require('@google-cloud/vision'); const productSearchClient = new vision.ProductSearchClient(); const assert = require('assert'); const tools = require(`@google-cloud/nodejs-repo-tools`); -const cmd = `node productSearch.v1p3beta1.js`; +const cmd = `node productSearch.js`; const cwd = path.join(__dirname, `..`, `productSearch`); // Shared fixture data for product tests diff --git a/samples/system-test/productSets.v1p3beta1.test.js b/samples/system-test/productSets.test.js similarity index 97% rename from samples/system-test/productSets.v1p3beta1.test.js rename to samples/system-test/productSets.test.js index 312defa0..d125d21a 100644 --- a/samples/system-test/productSets.v1p3beta1.test.js +++ b/samples/system-test/productSets.test.js @@ -17,11 +17,11 @@ const path = require(`path`); const uuid = require(`uuid`); -const vision = require('@google-cloud/vision').v1p3beta1; +const vision = require('@google-cloud/vision'); const productSearch = new vision.ProductSearchClient(); const assert = require('assert'); const tools = require(`@google-cloud/nodejs-repo-tools`); -const cmd = `node productSets.v1p3beta1.js`; +const cmd = `node productSets.js`; const cwd = path.join(__dirname, `..`, `productSearch`); // Shared fixture data for product tests diff --git a/samples/system-test/products.v1p3beta1.test.js b/samples/system-test/products.test.js similarity index 98% rename from samples/system-test/products.v1p3beta1.test.js rename to samples/system-test/products.test.js index d30a4277..5b44bbf9 100644 --- a/samples/system-test/products.v1p3beta1.test.js +++ b/samples/system-test/products.test.js @@ -17,11 +17,11 @@ const path = require(`path`); const uuid = require(`uuid`); -const vision = require('@google-cloud/vision').v1p3beta1; +const vision = require('@google-cloud/vision'); const productSearch = new vision.ProductSearchClient(); const assert = require('assert'); const tools = require(`@google-cloud/nodejs-repo-tools`); -const cmd = `node products.v1p3beta1.js`; +const cmd = `node products.js`; const cwd = path.join(__dirname, `..`, `productSearch`); // Shared fixture data for product tests diff --git a/samples/system-test/referenceImages.v1p3beta1.test.js b/samples/system-test/referenceImages.test.js similarity index 96% rename from samples/system-test/referenceImages.v1p3beta1.test.js rename to samples/system-test/referenceImages.test.js index 586dc1a3..76fd2792 100644 --- a/samples/system-test/referenceImages.v1p3beta1.test.js +++ b/samples/system-test/referenceImages.test.js @@ -17,11 +17,11 @@ const path = require(`path`); const uuid = require(`uuid`); -const vision = require('@google-cloud/vision').v1p3beta1; +const vision = require('@google-cloud/vision'); const productSearchClient = new vision.ProductSearchClient(); const assert = require('assert'); const tools = require(`@google-cloud/nodejs-repo-tools`); -const cmd = `node referenceImages.v1p3beta1.js`; +const cmd = `node referenceImages.js`; const cwd = path.join(__dirname, `..`, `productSearch`); // Shared fixture data for product tests diff --git a/samples/system-test/similarProducts.v1p3beta1.test.js b/samples/system-test/similarProducts.test.js similarity index 96% rename from samples/system-test/similarProducts.v1p3beta1.test.js rename to samples/system-test/similarProducts.test.js index bf11523e..ab70338f 100644 --- a/samples/system-test/similarProducts.v1p3beta1.test.js +++ b/samples/system-test/similarProducts.test.js @@ -16,11 +16,11 @@ 'use strict'; const path = require(`path`); -const vision = require('@google-cloud/vision').v1p3beta1; +const vision = require('@google-cloud/vision'); const productSearch = new vision.ProductSearchClient(); const assert = require('assert'); const tools = require(`@google-cloud/nodejs-repo-tools`); -const cmd = `node similarProducts.v1p3beta1.js`; +const cmd = `node similarProducts.js`; const cwd = path.join(__dirname, `..`, `productSearch`); const filter = ['', 'style=womens']; const localPath = './../resources/shoes_1.jpg'; @@ -28,7 +28,7 @@ const gcsUri = 'gs://nodejs-docs-samples/product-search/shoes_1.jpg'; // Shared fixture data for product tests //Need to have a product set already imported and indexed -// (gs://nodejs-docs-samples/product-search/indexed_product_set.csv) +// (gs://nodejs-docs-samples/product-search/indexed_product_sets.csv) const testSimilarProducts = { projectId: process.env.GCLOUD_PROJECT, location: 'us-west1',