-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generating GAPIC libraries for Google Cloud Functions v2beta (#175
) PiperOrigin-RevId: 459309277 Source-Link: googleapis/googleapis@2844793 Source-Link: googleapis/googleapis-gen@319987c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzE5OTg3Y2MwZTg3ODlhMzY4ZTM0ODgyMjcxYTkyYjA3MTdjOWM4ZiJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6060368
commit 4b41a51
Showing
20 changed files
with
20,320 additions
and
2 deletions.
There are no files selected for viewing
1,037 changes: 1,037 additions & 0 deletions
1,037
packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto
Large diffs are not rendered by default.
Oops, something went wrong.
3,336 changes: 3,336 additions & 0 deletions
3,336
packages/google-cloud-functions/protos/protos.d.ts
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
packages/google-cloud-functions/samples/generated/v2/function_service.create_function.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// 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 | ||
// | ||
// 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, function1) { | ||
// [START cloudfunctions_v2_generated_FunctionService_CreateFunction_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The project and location in which the function should be created, specified | ||
* in the format `projects/* /locations/*` | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Required. Function to be created. | ||
*/ | ||
// const function = {} | ||
/** | ||
* The ID to use for the function, which will become the final component of | ||
* the function's resource name. | ||
* This value should be 4-63 characters, and valid characters | ||
* are /[a-z][0-9]-/. | ||
*/ | ||
// const functionId = 'abc123' | ||
|
||
// Imports the Functions library | ||
const {FunctionServiceClient} = require('@google-cloud/functions').v2; | ||
|
||
// Instantiates a client | ||
const functionsClient = new FunctionServiceClient(); | ||
|
||
async function callCreateFunction() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
function1, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await functionsClient.createFunction(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callCreateFunction(); | ||
// [END cloudfunctions_v2_generated_FunctionService_CreateFunction_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
59 changes: 59 additions & 0 deletions
59
packages/google-cloud-functions/samples/generated/v2/function_service.delete_function.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// 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 | ||
// | ||
// 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 cloudfunctions_v2_generated_FunctionService_DeleteFunction_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the function which should be deleted. | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Functions library | ||
const {FunctionServiceClient} = require('@google-cloud/functions').v2; | ||
|
||
// Instantiates a client | ||
const functionsClient = new FunctionServiceClient(); | ||
|
||
async function callDeleteFunction() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await functionsClient.deleteFunction(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callDeleteFunction(); | ||
// [END cloudfunctions_v2_generated_FunctionService_DeleteFunction_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
59 changes: 59 additions & 0 deletions
59
...ges/google-cloud-functions/samples/generated/v2/function_service.generate_download_url.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// 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 | ||
// | ||
// 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 cloudfunctions_v2_generated_FunctionService_GenerateDownloadUrl_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of function for which source code Google Cloud Storage signed | ||
* URL should be generated. | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Functions library | ||
const {FunctionServiceClient} = require('@google-cloud/functions').v2; | ||
|
||
// Instantiates a client | ||
const functionsClient = new FunctionServiceClient(); | ||
|
||
async function callGenerateDownloadUrl() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await functionsClient.generateDownloadUrl(request); | ||
console.log(response); | ||
} | ||
|
||
callGenerateDownloadUrl(); | ||
// [END cloudfunctions_v2_generated_FunctionService_GenerateDownloadUrl_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
59 changes: 59 additions & 0 deletions
59
packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// 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 | ||
// | ||
// 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 cloudfunctions_v2_generated_FunctionService_GenerateUploadUrl_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The project and location in which the Google Cloud Storage signed URL | ||
* should be generated, specified in the format `projects/* /locations/*`. | ||
*/ | ||
// const parent = 'abc123' | ||
|
||
// Imports the Functions library | ||
const {FunctionServiceClient} = require('@google-cloud/functions').v2; | ||
|
||
// Instantiates a client | ||
const functionsClient = new FunctionServiceClient(); | ||
|
||
async function callGenerateUploadUrl() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
}; | ||
|
||
// Run request | ||
const response = await functionsClient.generateUploadUrl(request); | ||
console.log(response); | ||
} | ||
|
||
callGenerateUploadUrl(); | ||
// [END cloudfunctions_v2_generated_FunctionService_GenerateUploadUrl_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
58 changes: 58 additions & 0 deletions
58
packages/google-cloud-functions/samples/generated/v2/function_service.get_function.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// 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 | ||
// | ||
// 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 cloudfunctions_v2_generated_FunctionService_GetFunction_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the function which details should be obtained. | ||
*/ | ||
// const name = 'abc123' | ||
|
||
// Imports the Functions library | ||
const {FunctionServiceClient} = require('@google-cloud/functions').v2; | ||
|
||
// Instantiates a client | ||
const functionsClient = new FunctionServiceClient(); | ||
|
||
async function callGetFunction() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await functionsClient.getFunction(request); | ||
console.log(response); | ||
} | ||
|
||
callGetFunction(); | ||
// [END cloudfunctions_v2_generated_FunctionService_GetFunction_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
87 changes: 87 additions & 0 deletions
87
packages/google-cloud-functions/samples/generated/v2/function_service.list_functions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// 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 | ||
// | ||
// 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 cloudfunctions_v2_generated_FunctionService_ListFunctions_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The project and location from which the function should be listed, | ||
* specified in the format `projects/* /locations/*` | ||
* If you want to list functions in all locations, use "-" in place of a | ||
* location. When listing functions in all locations, if one or more | ||
* location(s) are unreachable, the response will contain functions from all | ||
* reachable locations along with the names of any unreachable locations. | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Maximum number of functions to return per call. | ||
*/ | ||
// const pageSize = 1234 | ||
/** | ||
* The value returned by the last | ||
* `ListFunctionsResponse`; indicates that | ||
* this is a continuation of a prior `ListFunctions` call, and that the | ||
* system should return the next page of data. | ||
*/ | ||
// const pageToken = 'abc123' | ||
/** | ||
* The filter for Functions that match the filter expression, | ||
* following the syntax outlined in https://google.aip.dev/160. | ||
*/ | ||
// const filter = 'abc123' | ||
/** | ||
* The sorting order of the resources returned. Value should be a comma | ||
* separated list of fields. The default sorting oder is ascending. | ||
* See https://google.aip.dev/132#ordering. | ||
*/ | ||
// const orderBy = 'abc123' | ||
|
||
// Imports the Functions library | ||
const {FunctionServiceClient} = require('@google-cloud/functions').v2; | ||
|
||
// Instantiates a client | ||
const functionsClient = new FunctionServiceClient(); | ||
|
||
async function callListFunctions() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
}; | ||
|
||
// Run request | ||
const iterable = await functionsClient.listFunctionsAsync(request); | ||
for await (const response of iterable) { | ||
console.log(response); | ||
} | ||
} | ||
|
||
callListFunctions(); | ||
// [END cloudfunctions_v2_generated_FunctionService_ListFunctions_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.