Skip to content

Commit

Permalink
feat: generating GAPIC libraries for Google Cloud Functions v2beta (#175
Browse files Browse the repository at this point in the history
)

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
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jul 8, 2022
1 parent 6060368 commit 4b41a51
Show file tree
Hide file tree
Showing 20 changed files with 20,320 additions and 2 deletions.

Large diffs are not rendered by default.

3,336 changes: 3,336 additions & 0 deletions packages/google-cloud-functions/protos/protos.d.ts

Large diffs are not rendered by default.

8,376 changes: 8,376 additions & 0 deletions packages/google-cloud-functions/protos/protos.js

Large diffs are not rendered by default.

985 changes: 985 additions & 0 deletions packages/google-cloud-functions/protos/protos.json

Large diffs are not rendered by default.

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));
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));
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));
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));
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));
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));
Loading

0 comments on commit 4b41a51

Please sign in to comment.