Skip to content

Commit

Permalink
docs: update jsdoc samples and json import paths (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Mar 12, 2019
1 parent c408c70 commit 2a54496
Show file tree
Hide file tree
Showing 19 changed files with 183 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
* can be trivially provided to the constructor of "java.awt.Color" in Java; it
* can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
* method in iOS; and, with just a little work, it can be easily formatted into
* a CSS "rgba()" string in JavaScript, as well. Here are some examples:
* a CSS "rgba()" string in JavaScript, as well.
*
* Note: this proto does not carry information about the absolute color space
* that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
* DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
* space.
*
* Example (Java):
*
Expand Down Expand Up @@ -84,7 +89,7 @@
* if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
* return nil;
* }
* Color* result = [Color alloc] init];
* Color* result = [[Color alloc] init];
* [result setRed:red];
* [result setGreen:green];
* [result setBlue:blue];
Expand Down
34 changes: 0 additions & 34 deletions packages/google-cloud-vision/src/v1/doc/google/type/doc_latlng.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,6 @@
* <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
* standard</a>. Values must be within normalized ranges.
*
* Example of normalization code in Python:
*
* def NormalizeLongitude(longitude):
* """Wraps decimal degrees longitude to [-180.0, 180.0]."""
* q, r = divmod(longitude, 360.0)
* if r > 180.0 or (r == 180.0 and q <= -1.0):
* return r - 360.0
* return r
*
* def NormalizeLatLng(latitude, longitude):
* """Wraps decimal degrees latitude and longitude to
* [-90.0, 90.0] and [-180.0, 180.0], respectively."""
* r = latitude % 360.0
* if r <= 90.0:
* return r, NormalizeLongitude(longitude)
* elif r >= 270.0:
* return r - 360, NormalizeLongitude(longitude)
* else:
* return 180 - r, NormalizeLongitude(longitude + 180.0)
*
* assert 180.0 == NormalizeLongitude(180.0)
* assert -180.0 == NormalizeLongitude(-180.0)
* assert -179.0 == NormalizeLongitude(181.0)
* assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
* assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
* assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
* assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
* assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
* assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
* assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
* assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
* assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
* assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
*
* @property {number} latitude
* The latitude in degrees. It must be in the range [-90.0, +90.0].
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./image_annotator_client_config');
const gapicConfig = require('./image_annotator_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -347,6 +347,13 @@ class ImageAnnotatorClient {
* .catch(err => {
* console.error(err);
* });
*
* const requests = [];
*
* // Handle the operation using the await pattern.
* const [operation] = await client.asyncBatchAnnotateFiles({requests: requests});
*
* const [response] = await operation.promise();
*/
asyncBatchAnnotateFiles(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
14 changes: 13 additions & 1 deletion packages/google-cloud-vision/src/v1/product_search_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./product_search_client_config');
const gapicConfig = require('./product_search_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -1813,6 +1813,18 @@ class ProductSearchClient {
* .catch(err => {
* console.error(err);
* });
*
* const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
* const inputConfig = {};
* const request = {
* parent: formattedParent,
* inputConfig: inputConfig,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.importProductSets(request);
*
* const [response] = await operation.promise();
*/
importProductSets(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
* can be trivially provided to the constructor of "java.awt.Color" in Java; it
* can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
* method in iOS; and, with just a little work, it can be easily formatted into
* a CSS "rgba()" string in JavaScript, as well. Here are some examples:
* a CSS "rgba()" string in JavaScript, as well.
*
* Note: this proto does not carry information about the absolute color space
* that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
* DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
* space.
*
* Example (Java):
*
Expand Down Expand Up @@ -84,7 +89,7 @@
* if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
* return nil;
* }
* Color* result = [Color alloc] init];
* Color* result = [[Color alloc] init];
* [result setRed:red];
* [result setGreen:green];
* [result setBlue:blue];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,6 @@
* <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
* standard</a>. Values must be within normalized ranges.
*
* Example of normalization code in Python:
*
* def NormalizeLongitude(longitude):
* """Wraps decimal degrees longitude to [-180.0, 180.0]."""
* q, r = divmod(longitude, 360.0)
* if r > 180.0 or (r == 180.0 and q <= -1.0):
* return r - 360.0
* return r
*
* def NormalizeLatLng(latitude, longitude):
* """Wraps decimal degrees latitude and longitude to
* [-90.0, 90.0] and [-180.0, 180.0], respectively."""
* r = latitude % 360.0
* if r <= 90.0:
* return r, NormalizeLongitude(longitude)
* elif r >= 270.0:
* return r - 360, NormalizeLongitude(longitude)
* else:
* return 180 - r, NormalizeLongitude(longitude + 180.0)
*
* assert 180.0 == NormalizeLongitude(180.0)
* assert -180.0 == NormalizeLongitude(-180.0)
* assert -179.0 == NormalizeLongitude(181.0)
* assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
* assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
* assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
* assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
* assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
* assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
* assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
* assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
* assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
* assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
*
* @property {number} latitude
* The latitude in degrees. It must be in the range [-90.0, +90.0].
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./image_annotator_client_config');
const gapicConfig = require('./image_annotator_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
* can be trivially provided to the constructor of "java.awt.Color" in Java; it
* can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
* method in iOS; and, with just a little work, it can be easily formatted into
* a CSS "rgba()" string in JavaScript, as well. Here are some examples:
* a CSS "rgba()" string in JavaScript, as well.
*
* Note: this proto does not carry information about the absolute color space
* that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
* DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
* space.
*
* Example (Java):
*
Expand Down Expand Up @@ -84,7 +89,7 @@
* if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
* return nil;
* }
* Color* result = [Color alloc] init];
* Color* result = [[Color alloc] init];
* [result setRed:red];
* [result setGreen:green];
* [result setBlue:blue];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,6 @@
* <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
* standard</a>. Values must be within normalized ranges.
*
* Example of normalization code in Python:
*
* def NormalizeLongitude(longitude):
* """Wraps decimal degrees longitude to [-180.0, 180.0]."""
* q, r = divmod(longitude, 360.0)
* if r > 180.0 or (r == 180.0 and q <= -1.0):
* return r - 360.0
* return r
*
* def NormalizeLatLng(latitude, longitude):
* """Wraps decimal degrees latitude and longitude to
* [-90.0, 90.0] and [-180.0, 180.0], respectively."""
* r = latitude % 360.0
* if r <= 90.0:
* return r, NormalizeLongitude(longitude)
* elif r >= 270.0:
* return r - 360, NormalizeLongitude(longitude)
* else:
* return 180 - r, NormalizeLongitude(longitude + 180.0)
*
* assert 180.0 == NormalizeLongitude(180.0)
* assert -180.0 == NormalizeLongitude(-180.0)
* assert -179.0 == NormalizeLongitude(181.0)
* assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
* assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
* assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
* assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
* assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
* assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
* assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
* assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
* assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
* assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
*
* @property {number} latitude
* The latitude in degrees. It must be in the range [-90.0, +90.0].
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./image_annotator_client_config');
const gapicConfig = require('./image_annotator_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -347,6 +347,13 @@ class ImageAnnotatorClient {
* .catch(err => {
* console.error(err);
* });
*
* const requests = [];
*
* // Handle the operation using the await pattern.
* const [operation] = await client.asyncBatchAnnotateFiles({requests: requests});
*
* const [response] = await operation.promise();
*/
asyncBatchAnnotateFiles(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
* can be trivially provided to the constructor of "java.awt.Color" in Java; it
* can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
* method in iOS; and, with just a little work, it can be easily formatted into
* a CSS "rgba()" string in JavaScript, as well. Here are some examples:
* a CSS "rgba()" string in JavaScript, as well.
*
* Note: this proto does not carry information about the absolute color space
* that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
* DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
* space.
*
* Example (Java):
*
Expand Down Expand Up @@ -84,7 +89,7 @@
* if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
* return nil;
* }
* Color* result = [Color alloc] init];
* Color* result = [[Color alloc] init];
* [result setRed:red];
* [result setGreen:green];
* [result setBlue:blue];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,6 @@
* <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
* standard</a>. Values must be within normalized ranges.
*
* Example of normalization code in Python:
*
* def NormalizeLongitude(longitude):
* """Wraps decimal degrees longitude to [-180.0, 180.0]."""
* q, r = divmod(longitude, 360.0)
* if r > 180.0 or (r == 180.0 and q <= -1.0):
* return r - 360.0
* return r
*
* def NormalizeLatLng(latitude, longitude):
* """Wraps decimal degrees latitude and longitude to
* [-90.0, 90.0] and [-180.0, 180.0], respectively."""
* r = latitude % 360.0
* if r <= 90.0:
* return r, NormalizeLongitude(longitude)
* elif r >= 270.0:
* return r - 360, NormalizeLongitude(longitude)
* else:
* return 180 - r, NormalizeLongitude(longitude + 180.0)
*
* assert 180.0 == NormalizeLongitude(180.0)
* assert -180.0 == NormalizeLongitude(-180.0)
* assert -179.0 == NormalizeLongitude(181.0)
* assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
* assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
* assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
* assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
* assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
* assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
* assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
* assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
* assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
* assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
*
* @property {number} latitude
* The latitude in degrees. It must be in the range [-90.0, +90.0].
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./image_annotator_client_config');
const gapicConfig = require('./image_annotator_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -347,6 +347,13 @@ class ImageAnnotatorClient {
* .catch(err => {
* console.error(err);
* });
*
* const requests = [];
*
* // Handle the operation using the await pattern.
* const [operation] = await client.asyncBatchAnnotateFiles({requests: requests});
*
* const [response] = await operation.promise();
*/
asyncBatchAnnotateFiles(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const gapicConfig = require('./product_search_client_config');
const gapicConfig = require('./product_search_client_config.json');
const gax = require('google-gax');
const merge = require('lodash.merge');
const path = require('path');
Expand Down Expand Up @@ -1830,6 +1830,18 @@ class ProductSearchClient {
* .catch(err => {
* console.error(err);
* });
*
* const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
* const inputConfig = {};
* const request = {
* parent: formattedParent,
* inputConfig: inputConfig,
* };
*
* // Handle the operation using the await pattern.
* const [operation] = await client.importProductSets(request);
*
* const [response] = await operation.promise();
*/
importProductSets(request, options, callback) {
if (options instanceof Function && callback === undefined) {
Expand Down
Loading

0 comments on commit 2a54496

Please sign in to comment.