Skip to content

Commit e911ac2

Browse files
chore(php): Revert two optional to required fields for dialogflow (#7579)
* feat: Add Proactive Generative Knowledge Assist endpoints and types feat: Add Generator related services and types feat: Add GenerateStatelessSuggestion related endpoints and types docs: A comment for field `name` in message `.google.cloud.dialogflow.v2.Conversation` is changed docs: A comment for field `conversation_stage` in message `.google.cloud.dialogflow.v2.Conversation` is changed docs: A comment for field `filter` in message `.google.cloud.dialogflow.v2.ListConversationsRequest` is changed docs: A comment for field `latest_message` in message `.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest` is changed docs: A comment for field `context_size` in message `.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest` is changed docs: A comment for field `assist_query_params` in message `.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest` is changed docs: A comment for field `latest_message` in message `.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest` is changed docs: A comment for field `max_context_size` in message `.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest` is changed docs: A comment for field `parent` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` is changed docs: A comment for field `session_id` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` is changed docs: A comment for field `conversation` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` is changed docs: A comment for field `latest_message` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` is changed docs: A comment for message `HumanAgentHandoffConfig` is changed docs: A comment for field `live_person_config` in message `.google.cloud.dialogflow.v2.HumanAgentHandoffConfig` is changed docs: A comment for field `audio` in message `.google.cloud.dialogflow.v2.AudioInput` is changed fix: Changed field behavior for an existing field `parent` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` fix: Changed field behavior for an existing field `session_id` in message `.google.cloud.dialogflow.v2.SearchKnowledgeRequest` PiperOrigin-RevId: 658854047 Source-Link: googleapis/googleapis@dcbd1d4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/feac4cf807f0ab41bd59878af46eb4fd2ece5679 Copy-Tag: eyJwIjoiRGlhbG9nZmxvdy8uT3dsQm90LnlhbWwiLCJoIjoiZmVhYzRjZjgwN2YwYWI0MWJkNTk4NzhhZjQ2ZWI0ZmQyZWNlNTY3OSJ9 * chore(php): Revert two optional to required fields for dialogflow PiperOrigin-RevId: 661351717 Source-Link: googleapis/googleapis@23bf1dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/54d98d650e643dee6df029165bd151aa57e9fbd1 Copy-Tag: eyJwIjoiRGlhbG9nZmxvdy8uT3dsQm90LnlhbWwiLCJoIjoiNTRkOThkNjUwZTY0M2RlZTZkZjAyOTE2NWJkMTUxYWE1N2U5ZmJkMSJ9
1 parent b7050aa commit e911ac2

File tree

103 files changed

+11426
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+11426
-167
lines changed

metadata/V2/AnswerRecord.php

188 Bytes
Binary file not shown.

metadata/V2/AudioConfig.php

143 Bytes
Binary file not shown.

metadata/V2/Conversation.php

916 Bytes
Binary file not shown.

metadata/V2/ConversationProfile.php

241 Bytes
Binary file not shown.

metadata/V2/EncryptionSpec.php

+48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

metadata/V2/Generator.php

5.72 KB
Binary file not shown.

metadata/V2/Participant.php

1.58 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/*
3+
* Copyright 2024 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dialogflow\V2\Client\ConversationsClient;
28+
use Google\Cloud\Dialogflow\V2\GenerateStatelessSuggestionRequest;
29+
use Google\Cloud\Dialogflow\V2\GenerateStatelessSuggestionResponse;
30+
31+
/**
32+
* Generates and returns a suggestion for a conversation that does not have a
33+
* resource created for it.
34+
*
35+
* @param string $formattedParent The parent resource to charge for the Suggestion's generation.
36+
* Format: `projects/<Project ID>/locations/<Location ID>`. Please see
37+
* {@see ConversationsClient::locationName()} for help formatting this field.
38+
*/
39+
function generate_stateless_suggestion_sample(string $formattedParent): void
40+
{
41+
// Create a client.
42+
$conversationsClient = new ConversationsClient();
43+
44+
// Prepare the request message.
45+
$request = (new GenerateStatelessSuggestionRequest())
46+
->setParent($formattedParent);
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var GenerateStatelessSuggestionResponse $response */
51+
$response = $conversationsClient->generateStatelessSuggestion($request);
52+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
53+
} catch (ApiException $ex) {
54+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
55+
}
56+
}
57+
58+
/**
59+
* Helper to execute the sample.
60+
*
61+
* This sample has been automatically generated and should be regarded as a code
62+
* template only. It will require modifications to work:
63+
* - It may require correct/in-range values for request initialization.
64+
* - It may require specifying regional endpoints when creating the service client,
65+
* please see the apiEndpoint client configuration option for more details.
66+
*/
67+
function callSample(): void
68+
{
69+
$formattedParent = ConversationsClient::locationName('[PROJECT]', '[LOCATION]');
70+
71+
generate_stateless_suggestion_sample($formattedParent);
72+
}
73+
// [END dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
/*
3+
* Copyright 2024 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dialogflow\V2\Client\EncryptionSpecServiceClient;
28+
use Google\Cloud\Dialogflow\V2\EncryptionSpec;
29+
use Google\Cloud\Dialogflow\V2\GetEncryptionSpecRequest;
30+
31+
/**
32+
* Gets location-level encryption key specification.
33+
*
34+
* @param string $formattedName The name of the encryption spec resource to get. Please see
35+
* {@see EncryptionSpecServiceClient::encryptionSpecName()} for help formatting this field.
36+
*/
37+
function get_encryption_spec_sample(string $formattedName): void
38+
{
39+
// Create a client.
40+
$encryptionSpecServiceClient = new EncryptionSpecServiceClient();
41+
42+
// Prepare the request message.
43+
$request = (new GetEncryptionSpecRequest())
44+
->setName($formattedName);
45+
46+
// Call the API and handle any network failures.
47+
try {
48+
/** @var EncryptionSpec $response */
49+
$response = $encryptionSpecServiceClient->getEncryptionSpec($request);
50+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
51+
} catch (ApiException $ex) {
52+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
53+
}
54+
}
55+
56+
/**
57+
* Helper to execute the sample.
58+
*
59+
* This sample has been automatically generated and should be regarded as a code
60+
* template only. It will require modifications to work:
61+
* - It may require correct/in-range values for request initialization.
62+
* - It may require specifying regional endpoints when creating the service client,
63+
* please see the apiEndpoint client configuration option for more details.
64+
*/
65+
function callSample(): void
66+
{
67+
$formattedName = EncryptionSpecServiceClient::encryptionSpecName('[PROJECT]', '[LOCATION]');
68+
69+
get_encryption_spec_sample($formattedName);
70+
}
71+
// [END dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/*
3+
* Copyright 2024 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START dialogflow_v2_generated_EncryptionSpecService_GetLocation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dialogflow\V2\Client\EncryptionSpecServiceClient;
28+
use Google\Cloud\Location\GetLocationRequest;
29+
use Google\Cloud\Location\Location;
30+
31+
/**
32+
* Gets information about a location.
33+
*
34+
* This sample has been automatically generated and should be regarded as a code
35+
* template only. It will require modifications to work:
36+
* - It may require correct/in-range values for request initialization.
37+
* - It may require specifying regional endpoints when creating the service client,
38+
* please see the apiEndpoint client configuration option for more details.
39+
*/
40+
function get_location_sample(): void
41+
{
42+
// Create a client.
43+
$encryptionSpecServiceClient = new EncryptionSpecServiceClient();
44+
45+
// Prepare the request message.
46+
$request = new GetLocationRequest();
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var Location $response */
51+
$response = $encryptionSpecServiceClient->getLocation($request);
52+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
53+
} catch (ApiException $ex) {
54+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
55+
}
56+
}
57+
// [END dialogflow_v2_generated_EncryptionSpecService_GetLocation_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
/*
3+
* Copyright 2024 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Dialogflow\V2\Client\EncryptionSpecServiceClient;
29+
use Google\Cloud\Dialogflow\V2\EncryptionSpec;
30+
use Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest;
31+
use Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecResponse;
32+
use Google\Rpc\Status;
33+
34+
/**
35+
* Initializes a location-level encryption key specification. An error will
36+
* be thrown if the location has resources already created before the
37+
* initialization. Once the encryption specification is initialized at a
38+
* location, it is immutable and all newly created resources under the
39+
* location will be encrypted with the existing specification.
40+
*
41+
* @param string $encryptionSpecKmsKey The name of customer-managed encryption key that is used to
42+
* secure a resource and its sub-resources. If empty, the resource is secured
43+
* by the default Google encryption key. Only the key in the same location as
44+
* this resource is allowed to be used for encryption. Format:
45+
* `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`
46+
*/
47+
function initialize_encryption_spec_sample(string $encryptionSpecKmsKey): void
48+
{
49+
// Create a client.
50+
$encryptionSpecServiceClient = new EncryptionSpecServiceClient();
51+
52+
// Prepare the request message.
53+
$encryptionSpec = (new EncryptionSpec())
54+
->setKmsKey($encryptionSpecKmsKey);
55+
$request = (new InitializeEncryptionSpecRequest())
56+
->setEncryptionSpec($encryptionSpec);
57+
58+
// Call the API and handle any network failures.
59+
try {
60+
/** @var OperationResponse $response */
61+
$response = $encryptionSpecServiceClient->initializeEncryptionSpec($request);
62+
$response->pollUntilComplete();
63+
64+
if ($response->operationSucceeded()) {
65+
/** @var InitializeEncryptionSpecResponse $result */
66+
$result = $response->getResult();
67+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
68+
} else {
69+
/** @var Status $error */
70+
$error = $response->getError();
71+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
72+
}
73+
} catch (ApiException $ex) {
74+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
75+
}
76+
}
77+
78+
/**
79+
* Helper to execute the sample.
80+
*
81+
* This sample has been automatically generated and should be regarded as a code
82+
* template only. It will require modifications to work:
83+
* - It may require correct/in-range values for request initialization.
84+
* - It may require specifying regional endpoints when creating the service client,
85+
* please see the apiEndpoint client configuration option for more details.
86+
*/
87+
function callSample(): void
88+
{
89+
$encryptionSpecKmsKey = '[KMS_KEY]';
90+
91+
initialize_encryption_spec_sample($encryptionSpecKmsKey);
92+
}
93+
// [END dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync]

0 commit comments

Comments
 (0)