Skip to content

Commit

Permalink
fix: update generated samples to reflect string arrays (#1331)
Browse files Browse the repository at this point in the history
* fix: update samples to reflect arrays
  • Loading branch information
sofisl authored Feb 15, 2023
1 parent fbda4e4 commit e49e945
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function main(parent) {
* The request becomes a no-op if the asset name list is empty, and the max
* size of the asset name list is 100 in one request.
*/
// const assetNames = 'abc123'
// const assetNames = ['abc','def']
/**
* Optional. The content type.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function main(parent, outputConfig) {
* Inventory (https://cloud.google.com/asset-inventory/docs/overview)
* for all supported asset types.
*/
// const assetTypes = 'abc123'
// const assetTypes = ['abc','def']
/**
* Asset content type. If not specified, no content but the asset name will be
* returned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function main() {
/**
* The configuration for specifying what content to redact from images.
*/
// const imageRedactionConfigs = 1234
// const imageRedactionConfigs = [1,2,3,4]
/**
* Whether the response should include findings along with the redacted
* image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function main() {
* Required. The data encrypted with the named CryptoKeyVersion google.cloud.kms.v1.CryptoKeyVersion's public
* key using OAEP.
*/
// const ciphertext = 'Buffer.from('string')'
// const ciphertext = Buffer.from('string')

// Imports the Kms library
const {KeyManagementServiceClient} = require('kms').v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ function main() {
* Required. The encrypted data originally returned in
* EncryptResponse.ciphertext google.cloud.kms.v1.EncryptResponse.ciphertext.
*/
// const ciphertext = 'Buffer.from('string')'
// const ciphertext = Buffer.from('string')
/**
* Optional data that must match the data originally supplied in
* EncryptRequest.additional_authenticated_data google.cloud.kms.v1.EncryptRequest.additional_authenticated_data.
*/
// const additionalAuthenticatedData = 'Buffer.from('string')'
// const additionalAuthenticatedData = Buffer.from('string')

// Imports the Kms library
const {KeyManagementServiceClient} = require('kms').v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function main() {
* plaintext and additional_authenticated_data fields must be no larger than
* 8KiB.
*/
// const plaintext = 'Buffer.from('string')'
// const plaintext = Buffer.from('string')
/**
* Optional data that, if specified, must also be provided during decryption
* through DecryptRequest.additional_authenticated_data google.cloud.kms.v1.DecryptRequest.additional_authenticated_data.
Expand All @@ -55,7 +55,7 @@ function main() {
* plaintext and additional_authenticated_data fields must be no larger than
* 8KiB.
*/
// const additionalAuthenticatedData = 'Buffer.from('string')'
// const additionalAuthenticatedData = Buffer.from('string')

// Imports the Kms library
const {KeyManagementServiceClient} = require('kms').v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function main() {
* This format is the same as the format produced by PKCS#11 mechanism
* CKM_RSA_AES_KEY_WRAP.
*/
// const rsaAesWrappedKey = 'Buffer.from('string')'
// const rsaAesWrappedKey = Buffer.from('string')

// Imports the Kms library
const {KeyManagementServiceClient} = require('kms').v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function main(resourceNames) {
* * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
* Projects listed in the `project_ids` field are added to this list.
*/
// const resourceNames = 'abc123'
// const resourceNames = ['abc','def']
/**
* Optional. A filter that chooses which log entries to return. See Advanced
* Logs Queries (https://cloud.google.com/logging/docs/view/advanced-queries).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function main(parent) {
* * `billingAccounts/[BILLING_ACCOUNT_ID]`
* * `folders/[FOLDER_ID]`
*/
// const resourceNames = 'abc123'
// const resourceNames = ['abc','def']

// Imports the Logging library
const {LoggingServiceV2Client} = require('logging').v2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function main(resourceNames) {
* * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
* * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
*/
// const resourceNames = 'abc123'
// const resourceNames = ['abc','def']
/**
* Optional. A filter that chooses which log entries to return. See Advanced
* Logs Filters (https://cloud.google.com/logging/docs/view/advanced_filters).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function main(entries) {
* as a label in this parameter, then the log entry's label is not changed.
* See LogEntry google.logging.v2.LogEntry.
*/
// const labels = 1234
// const labels = [1,2,3,4]
/**
* Required. The log entries to send to Logging. The order of log
* entries in this list does not matter. Values supplied in this method's
Expand All @@ -83,7 +83,7 @@ function main(entries) {
* `entries.write`, you should try to include several log entries in this
* list, rather than calling this method for each individual log entry.
*/
// const entries = 1234
// const entries = [1,2,3,4]
/**
* Optional. Whether valid entries should be written even if some other
* entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function main(name, timeSeries) {
* all label values for the metric and the monitored resource.
* The maximum number of `TimeSeries` objects per `Create` request is 200.
*/
// const timeSeries = 1234
// const timeSeries = [1,2,3,4]

// Imports the Monitoring library
const {MetricServiceClient} = require('monitoring').v3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function main(resource, permissions) {
* information see
* IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
*/
// const permissions = 'abc123'
// const permissions = ['abc','def']

// Imports the Tasks library
const {CloudTasksClient} = require('tasks').v2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, out
/**
* Required. Specify up to 10 language codes here.
*/
// const targetLanguageCodes = 'abc123'
// const targetLanguageCodes = ['abc','def']
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is model name. Value can be a built-in general model,
Expand All @@ -58,14 +58,14 @@ function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, out
* If the map is empty or a specific model is
* not requested for a language pair, then default google model (nmt) is used.
*/
// const models = 1234
// const models = [1,2,3,4]
/**
* Required. Input configurations.
* The total number of files matched should be <= 1000.
* The total content size should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*/
// const inputConfigs = 1234
// const inputConfigs = [1,2,3,4]
/**
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
Expand All @@ -76,7 +76,7 @@ function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, out
* Optional. Glossaries to be applied for translation.
* It's keyed by target language code.
*/
// const glossaries = 1234
// const glossaries = [1,2,3,4]
/**
* Optional. The labels with user-defined metadata for the request.
* Label keys and values can be no longer than 63 characters
Expand All @@ -85,7 +85,7 @@ function main(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, out
* Label values are optional. Label keys must start with a letter.
* See https://cloud.google.com/translate/docs/labels for more information.
*/
// const labels = 1234
// const labels = [1,2,3,4]

// Imports the Translation library
const {TranslationServiceClient} = require('translation').v3beta1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function main(parent) {
* Label values are optional. Label keys must start with a letter.
* See https://cloud.google.com/translate/docs/labels for more information.
*/
// const labels = 1234
// const labels = [1,2,3,4]

// Imports the Translation library
const {TranslationServiceClient} = require('translation').v3beta1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function main(contents, targetLanguageCode, parent) {
* We recommend the total content be less than 30k codepoints.
* Use BatchTranslateText for larger text.
*/
// const contents = 'abc123'
// const contents = ['abc','def']
/**
* Optional. The format of the source text, for example, "text/html",
* "text/plain". If left blank, the MIME type defaults to "text/html".
Expand Down Expand Up @@ -93,7 +93,7 @@ function main(contents, targetLanguageCode, parent) {
* Label values are optional. Label keys must start with a letter.
* See https://cloud.google.com/translate/docs/labels for more information.
*/
// const labels = 1234
// const labels = [1,2,3,4]

// Imports the Translation library
const {TranslationServiceClient} = require('translation').v3beta1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ function main(features) {
* If unset, the input video(s) should be specified via `input_uri`.
* If set, `input_uri` should be unset.
*/
// const inputContent = 'Buffer.from('string')'
// const inputContent = Buffer.from('string')
/**
* Required. Requested video annotation features.
*/
// const features = 1234
// const features = [1,2,3,4]
/**
* Additional video context and/or feature-specific parameters.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,17 @@

{%- macro printTypeExample(type) -%}
{%- if type.includes('Buffer') -%}
'Buffer.from('string')'
Buffer.from('string')
{%- elif type.includes('boolean') -%}
true
{%- elif type.includes('string[]') -%}
['abc','def']
{%- elif type.includes('[]') -%}
[1,2,3,4]
{%- elif type.includes('string') -%}
'abc123'
{%- elif type.includes('number') -%}
1234
{%- elif type.includes('[]') -%}
[1,2,3,4]
{%- else -%}
{}
{%- endif -%}
Expand Down

0 comments on commit e49e945

Please sign in to comment.