Skip to content

Commit

Permalink
feat: [Functions] Updates from OwlBot (#4932)
Browse files Browse the repository at this point in the history
* feat: update client libraries to support Database operations

PiperOrigin-RevId: 419710013

Source-Link: googleapis/googleapis@b7c9d05

Source-Link: googleapis/googleapis-gen@ae49827
Copy-Tag: eyJwIjoiRnVuY3Rpb25zLy5Pd2xCb3QueWFtbCIsImgiOiJhZTQ5ODI3OWM0ZTcxY2Q0YWE2ZTA2NTVlOTJhNjkzZGY5NzQ3MmM0In0=

* 🦉 Updates from OwlBot

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 Jan 8, 2022
1 parent f527bd6 commit 6abbb28
Show file tree
Hide file tree
Showing 17 changed files with 1,246 additions and 18 deletions.
Binary file modified Functions/metadata/V1/Functions.php
Binary file not shown.
Binary file modified Functions/metadata/V1/Operations.php
Binary file not shown.
523 changes: 521 additions & 2 deletions Functions/src/V1/CloudFunction.php

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Functions/src/V1/CloudFunction/IngressSettings.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Functions/src/V1/CloudFunction/VpcConnectorEgressSettings.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Functions/src/V1/CloudFunctionsServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/*
* GENERATED CODE WARNING
* Generated by gapic-generator-php from the file
* https://github.com/google/googleapis/blob/master/google/cloud/functions/v1/functions.proto
* https://github.com/googleapis/googleapis/blob/master/google/cloud/functions/v1/functions.proto
* Updates to the above are reflected here through a refresh process.
*/

Expand Down
2 changes: 1 addition & 1 deletion Functions/src/V1/CreateFunctionRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Functions/src/V1/EventTrigger.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Functions/src/V1/FailurePolicy/Retry.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 75 additions & 1 deletion Functions/src/V1/Gapic/CloudFunctionsServiceGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/*
* GENERATED CODE WARNING
* Generated by gapic-generator-php from the file
* https://github.com/google/googleapis/blob/master/google/cloud/functions/v1/functions.proto
* https://github.com/googleapis/googleapis/blob/master/google/cloud/functions/v1/functions.proto
* Updates to the above are reflected here through a refresh process.
*/

Expand Down Expand Up @@ -114,8 +114,12 @@ class CloudFunctionsServiceGapicClient

private static $cloudFunctionNameTemplate;

private static $cryptoKeyNameTemplate;

private static $locationNameTemplate;

private static $repositoryNameTemplate;

private static $pathTemplateMap;

private $operationsClient;
Expand Down Expand Up @@ -159,6 +163,17 @@ private static function getCloudFunctionNameTemplate()
return self::$cloudFunctionNameTemplate;
}

private static function getCryptoKeyNameTemplate()
{
if (self::$cryptoKeyNameTemplate == null) {
self::$cryptoKeyNameTemplate = new PathTemplate(
'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'
);
}

return self::$cryptoKeyNameTemplate;
}

private static function getLocationNameTemplate()
{
if (self::$locationNameTemplate == null) {
Expand All @@ -170,12 +185,25 @@ private static function getLocationNameTemplate()
return self::$locationNameTemplate;
}

private static function getRepositoryNameTemplate()
{
if (self::$repositoryNameTemplate == null) {
self::$repositoryNameTemplate = new PathTemplate(
'projects/{project}/locations/{location}/repositories/{repository}'
);
}

return self::$repositoryNameTemplate;
}

private static function getPathTemplateMap()
{
if (self::$pathTemplateMap == null) {
self::$pathTemplateMap = [
'cloudFunction' => self::getCloudFunctionNameTemplate(),
'cryptoKey' => self::getCryptoKeyNameTemplate(),
'location' => self::getLocationNameTemplate(),
'repository' => self::getRepositoryNameTemplate(),
];
}

Expand All @@ -201,6 +229,31 @@ public static function cloudFunctionName($project, $location, $function)
]);
}

/**
* Formats a string containing the fully-qualified path to represent a crypto_key
* resource.
*
* @param string $project
* @param string $location
* @param string $keyRing
* @param string $cryptoKey
*
* @return string The formatted crypto_key resource.
*/
public static function cryptoKeyName(
$project,
$location,
$keyRing,
$cryptoKey
) {
return self::getCryptoKeyNameTemplate()->render([
'project' => $project,
'location' => $location,
'key_ring' => $keyRing,
'crypto_key' => $cryptoKey,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a location
* resource.
Expand All @@ -218,12 +271,33 @@ public static function locationName($project, $location)
]);
}

/**
* Formats a string containing the fully-qualified path to represent a repository
* resource.
*
* @param string $project
* @param string $location
* @param string $repository
*
* @return string The formatted repository resource.
*/
public static function repositoryName($project, $location, $repository)
{
return self::getRepositoryNameTemplate()->render([
'project' => $project,
'location' => $location,
'repository' => $repository,
]);
}

/**
* Parses a formatted name string and returns an associative array of the components in the name.
* The following name formats are supported:
* Template: Pattern
* - cloudFunction: projects/{project}/locations/{location}/functions/{function}
* - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
* - location: projects/{project}/locations/{location}
* - repository: projects/{project}/locations/{location}/repositories/{repository}
*
* The optional $template argument can be supplied to specify a particular pattern,
* and must match one of the templates listed above. If no $template argument is
Expand Down
2 changes: 0 additions & 2 deletions Functions/src/V1/HttpsTrigger/SecurityLevel.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 82 additions & 2 deletions Functions/src/V1/OperationMetadataV1.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6abbb28

Please sign in to comment.