Skip to content

Commit

Permalink
fix: added required annotations (#6779)
Browse files Browse the repository at this point in the history
* fix!: added required annotations
docs: updated comments explaining if a field is optional or required

CreateKeyRequest.display_name and PrivatePasswordLeakVerification.lookup_hash_prefix are now required.
PiperOrigin-RevId: 580254588
Source-Link: googleapis/googleapis@22df66c
Source-Link: googleapis/googleapis-gen@488324d
Copy-Tag: eyJwIjoiUmVjYXB0Y2hhRW50ZXJwcmlzZS8uT3dsQm90LnlhbWwiLCJoIjoiNDg4MzI0ZGZjMTU3MTAxYzc2NGIxMTBmNThkOTQ1YmNjMjg2MDBiZSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Nov 10, 2023
1 parent d3d8e8a commit 65bf80d
Show file tree
Hide file tree
Showing 30 changed files with 871 additions and 792 deletions.
Binary file modified RecaptchaEnterprise/metadata/V1/Recaptchaenterprise.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
* @param string $formattedParent The name of the project in which the key will be created, in the
* format `projects/{project}`. Please see
* {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field.
* @param string $keyDisplayName Human-readable display name of this key. Modifiable by user.
*/
function create_key_sample(string $formattedParent): void
function create_key_sample(string $formattedParent, string $keyDisplayName): void
{
// Create a client.
$recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient();

// Prepare any non-scalar elements to be passed along with the request.
$key = new Key();
$key = (new Key())
->setDisplayName($keyDisplayName);

// Call the API and handle any network failures.
try {
Expand All @@ -64,7 +66,8 @@ function create_key_sample(string $formattedParent): void
function callSample(): void
{
$formattedParent = RecaptchaEnterpriseServiceClient::projectName('[PROJECT]');
$keyDisplayName = '[DISPLAY_NAME]';

create_key_sample($formattedParent);
create_key_sample($formattedParent, $keyDisplayName);
}
// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@
/**
* Updates the specified key.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
* @param string $keyDisplayName Human-readable display name of this key. Modifiable by user.
*/
function update_key_sample(): void
function update_key_sample(string $keyDisplayName): void
{
// Create a client.
$recaptchaEnterpriseServiceClient = new RecaptchaEnterpriseServiceClient();

// Prepare any non-scalar elements to be passed along with the request.
$key = new Key();
$key = (new Key())
->setDisplayName($keyDisplayName);

// Call the API and handle any network failures.
try {
Expand All @@ -53,4 +50,20 @@ function update_key_sample(): void
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$keyDisplayName = '[DISPLAY_NAME]';

update_key_sample($keyDisplayName);
}
// [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync]
14 changes: 7 additions & 7 deletions RecaptchaEnterprise/src/V1/AccountDefenderAssessment.php

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

36 changes: 18 additions & 18 deletions RecaptchaEnterprise/src/V1/AccountVerificationInfo.php

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

54 changes: 29 additions & 25 deletions RecaptchaEnterprise/src/V1/AndroidKeySettings.php

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

Loading

0 comments on commit 65bf80d

Please sign in to comment.