diff --git a/DialogflowCx/.OwlBot.yaml b/DialogflowCx/.OwlBot.yaml
new file mode 100644
index 000000000000..6863ea7e8f12
--- /dev/null
+++ b/DialogflowCx/.OwlBot.yaml
@@ -0,0 +1,4 @@
+deep-copy-regex:
+ - source: /google/cloud/dialogflow/cx/(v3)/.*-php/(.*)
+ dest: /owl-bot-staging/DialogflowCx/$1/$2
+api-name: DialogflowCx
diff --git a/DialogflowCx/.gitattributes b/DialogflowCx/.gitattributes
new file mode 100644
index 000000000000..8119e7fcc1b2
--- /dev/null
+++ b/DialogflowCx/.gitattributes
@@ -0,0 +1,8 @@
+/*.xml.dist export-ignore
+/.OwlBot.yaml export-ignore
+/.github export-ignore
+/.repo-metadata.json export-ignore
+/owlbot.py export-ignore
+/src/**/gapic_metadata.json export-ignore
+/samples export-ignore
+/tests export-ignore
diff --git a/DialogflowCx/.github/pull_request_template.md b/DialogflowCx/.github/pull_request_template.md
new file mode 100644
index 000000000000..d93d2c3013f9
--- /dev/null
+++ b/DialogflowCx/.github/pull_request_template.md
@@ -0,0 +1,24 @@
+**PLEASE READ THIS ENTIRE MESSAGE**
+
+Hello, and thank you for your contribution! Please note that this repository is
+a read-only split of `googleapis/google-cloud-php`. As such, we are
+unable to accept pull requests to this repository.
+
+We welcome your pull request and would be happy to consider it for inclusion in
+our library if you follow these steps:
+
+* Clone the parent client library repository:
+
+```sh
+$ git clone git@github.com:googleapis/google-cloud-php.git
+```
+
+* Move your changes into the correct location in that library. Library code
+belongs in `DialogflowCx/src`, and tests in `DialogflowCx/tests`.
+
+* Push the changes in a new branch to a fork, and open a new pull request
+[here](https://github.com/googleapis/google-cloud-php).
+
+Thanks again, and we look forward to seeing your proposed change!
+
+The Google Cloud PHP team
diff --git a/DialogflowCx/.repo-metadata.json b/DialogflowCx/.repo-metadata.json
new file mode 100644
index 000000000000..45b32b0b95d3
--- /dev/null
+++ b/DialogflowCx/.repo-metadata.json
@@ -0,0 +1,8 @@
+{
+ "language": "php",
+ "distribution_name": "google/cloud-dialogflow-cx",
+ "release_level": "preview",
+ "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest",
+ "library_type": "GAPIC_AUTO",
+ "api_shortname": "dialogflow"
+}
diff --git a/DialogflowCx/CONTRIBUTING.md b/DialogflowCx/CONTRIBUTING.md
new file mode 100644
index 000000000000..76ea811cacdb
--- /dev/null
+++ b/DialogflowCx/CONTRIBUTING.md
@@ -0,0 +1,10 @@
+# How to Contribute
+
+We'd love to accept your patches and contributions to this project. We accept
+and review pull requests against the main
+[Google Cloud PHP](https://github.com/googleapis/google-cloud-php)
+repository, which contains all of our client libraries. You will also need to
+sign a Contributor License Agreement. For more details about how to contribute,
+see the
+[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md)
+file in the main Google Cloud PHP repository.
diff --git a/DialogflowCx/LICENSE b/DialogflowCx/LICENSE
new file mode 100644
index 000000000000..8f71f43fee3f
--- /dev/null
+++ b/DialogflowCx/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ 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
+
+ http://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.
+
diff --git a/DialogflowCx/README.md b/DialogflowCx/README.md
new file mode 100644
index 000000000000..a4d07a59723d
--- /dev/null
+++ b/DialogflowCx/README.md
@@ -0,0 +1,45 @@
+# Google Cloud Dialogflow Cx for PHP
+
+> Idiomatic PHP client for [Google Cloud Dialogflow Cx](https://cloud.google.com/dialogflow).
+
+[![Latest Stable Version](https://poser.pugx.org/google/cloud-dialogflow-cx/v/stable)](https://packagist.org/packages/google/cloud-dialogflow-cx) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-dialogflow-cx.svg)](https://packagist.org/packages/google/cloud-dialogflow-cx)
+
+* [API documentation](https://cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest)
+
+**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any
+support requests, bug reports, or development contributions should be directed to
+that project.
+
+### Installation
+
+To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/).
+
+Now, install this component:
+
+```sh
+$ composer require google/cloud-dialogflow-cx
+```
+
+> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference)
+> for PHP
+
+This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits
+offered by gRPC (such as streaming methods) please see our
+[gRPC installation guide](https://cloud.google.com/php/grpc).
+
+### Authentication
+
+Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information
+on authenticating your client. Once authenticated, you'll be ready to start making requests.
+
+### Sample
+
+See the [samples directory](https://github.com/googleapis/google-cloud-php-dialogflow-cx/tree/main/samples) for a canonical list of samples.
+
+### Version
+
+This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates.
+
+### Next Steps
+
+1. Understand the [official documentation](https://cloud.google.com/dialogflow/cx/docs/reference).
diff --git a/DialogflowCx/VERSION b/DialogflowCx/VERSION
new file mode 100644
index 000000000000..77d6f4ca2371
--- /dev/null
+++ b/DialogflowCx/VERSION
@@ -0,0 +1 @@
+0.0.0
diff --git a/DialogflowCx/composer.json b/DialogflowCx/composer.json
new file mode 100644
index 000000000000..b3da400a0b9e
--- /dev/null
+++ b/DialogflowCx/composer.json
@@ -0,0 +1,30 @@
+{
+ "name": "google/cloud-dialogflow-cx",
+ "description": "Google Cloud Dialogflow Cx Client for PHP",
+ "license": "Apache-2.0",
+ "minimum-stability": "stable",
+ "autoload": {
+ "psr-4": {
+ "Google\\Cloud\\Dialogflow\\Cx\\": "src",
+ "GPBMetadata\\Google\\Cloud\\Dialogflow\\Cx\\": "metadata"
+ }
+ },
+ "extra": {
+ "component": {
+ "id": "cloud-dialogflow-cx",
+ "path": "DialogflowCx",
+ "target": "googleapis/google-cloud-php-dialogflow-cx"
+ }
+ },
+ "require": {
+ "php": ">=7.4",
+ "google/gax": "^1.25.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
+ },
+ "suggest": {
+ "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.",
+ "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions."
+ }
+}
diff --git a/DialogflowCx/metadata/V3/AdvancedSettings.php b/DialogflowCx/metadata/V3/AdvancedSettings.php
new file mode 100644
index 000000000000..c48431c45e09
--- /dev/null
+++ b/DialogflowCx/metadata/V3/AdvancedSettings.php
@@ -0,0 +1,41 @@
+internalAddGeneratedFile(
+ '
+
+5google/cloud/dialogflow/cx/v3/advanced_settings.protogoogle.cloud.dialogflow.cx.v3\'google/cloud/dialogflow/cx/v3/gcs.proto"
+AdvancedSettingsS
+audio_export_gcs_destination (2-.google.cloud.dialogflow.cx.v3.GcsDestinationS
+
dtmf_settings (2<.google.cloud.dialogflow.cx.v3.AdvancedSettings.DtmfSettingsY
+logging_settings (2?.google.cloud.dialogflow.cx.v3.AdvancedSettings.LoggingSettingsI
+DtmfSettings
+enabled (
+
+max_digits (
+finish_digit ( Y
+LoggingSettings"
+enable_stackdriver_logging ("
+enable_interaction_logging (B
+!com.google.cloud.dialogflow.cx.v3BAdvancedSettingsProtoPZ1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpbDFGoogle.Cloud.Dialogflow.Cx.V3!Google::Cloud::Dialogflow::CX::V3bproto3'
+ , true);
+
+ static::$is_initialized = true;
+ }
+}
+
diff --git a/DialogflowCx/metadata/V3/Agent.php b/DialogflowCx/metadata/V3/Agent.php
new file mode 100644
index 000000000000..713547082285
Binary files /dev/null and b/DialogflowCx/metadata/V3/Agent.php differ
diff --git a/DialogflowCx/metadata/V3/AudioConfig.php b/DialogflowCx/metadata/V3/AudioConfig.php
new file mode 100644
index 000000000000..90ebbbe774a6
Binary files /dev/null and b/DialogflowCx/metadata/V3/AudioConfig.php differ
diff --git a/DialogflowCx/metadata/V3/Changelog.php b/DialogflowCx/metadata/V3/Changelog.php
new file mode 100644
index 000000000000..b4e5c5eb2958
--- /dev/null
+++ b/DialogflowCx/metadata/V3/Changelog.php
@@ -0,0 +1,59 @@
+internalAddGeneratedFile(
+ '
+
+-google/cloud/dialogflow/cx/v3/changelog.protogoogle.cloud.dialogflow.cx.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/timestamp.proto"
+ListChangelogsRequest;
+parent ( B+AA%#dialogflow.googleapis.com/Changelog
+filter (
+ page_size (
+
+page_token ( "o
+ListChangelogsResponse<
+
+changelogs (2(.google.cloud.dialogflow.cx.v3.Changelog
+next_page_token ( "P
+GetChangelogRequest9
+name ( B+AA%
+#dialogflow.googleapis.com/Changelog"
+ Changelog
+name (
+
+user_email (
+display_name (
+action (
+type (
+resource ( /
+create_time (2.google.protobuf.Timestamp:wAt
+#dialogflow.googleapis.com/ChangelogMprojects/{project}/locations/{location}/agents/{agent}/changelogs/{changelog}2
+
+Changelogs
+ListChangelogs4.google.cloud.dialogflow.cx.v3.ListChangelogsRequest5.google.cloud.dialogflow.cx.v3.ListChangelogsResponse"H97/v3/{parent=projects/*/locations/*/agents/*}/changelogsAparent
+GetChangelog2.google.cloud.dialogflow.cx.v3.GetChangelogRequest(.google.cloud.dialogflow.cx.v3.Changelog"F97/v3/{name=projects/*/locations/*/agents/*/changelogs/*}AnamexAdialogflow.googleapis.comAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB
+!com.google.cloud.dialogflow.cx.v3BChangelogProtoPZ1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpbDFGoogle.Cloud.Dialogflow.Cx.V3!Google::Cloud::Dialogflow::CX::V3bproto3'
+ , true);
+
+ static::$is_initialized = true;
+ }
+}
+
diff --git a/DialogflowCx/metadata/V3/DataStoreConnection.php b/DialogflowCx/metadata/V3/DataStoreConnection.php
new file mode 100644
index 000000000000..aaea48045058
Binary files /dev/null and b/DialogflowCx/metadata/V3/DataStoreConnection.php differ
diff --git a/DialogflowCx/metadata/V3/Deployment.php b/DialogflowCx/metadata/V3/Deployment.php
new file mode 100644
index 000000000000..f759d26198bb
Binary files /dev/null and b/DialogflowCx/metadata/V3/Deployment.php differ
diff --git a/DialogflowCx/metadata/V3/EntityType.php b/DialogflowCx/metadata/V3/EntityType.php
new file mode 100644
index 000000000000..bcc239cd9871
Binary files /dev/null and b/DialogflowCx/metadata/V3/EntityType.php differ
diff --git a/DialogflowCx/metadata/V3/Environment.php b/DialogflowCx/metadata/V3/Environment.php
new file mode 100644
index 000000000000..3262f8bbc900
Binary files /dev/null and b/DialogflowCx/metadata/V3/Environment.php differ
diff --git a/DialogflowCx/metadata/V3/Experiment.php b/DialogflowCx/metadata/V3/Experiment.php
new file mode 100644
index 000000000000..464a8986cd36
Binary files /dev/null and b/DialogflowCx/metadata/V3/Experiment.php differ
diff --git a/DialogflowCx/metadata/V3/Flow.php b/DialogflowCx/metadata/V3/Flow.php
new file mode 100644
index 000000000000..e9e42e1efdf0
Binary files /dev/null and b/DialogflowCx/metadata/V3/Flow.php differ
diff --git a/DialogflowCx/metadata/V3/Fulfillment.php b/DialogflowCx/metadata/V3/Fulfillment.php
new file mode 100644
index 000000000000..7c9288abf525
Binary files /dev/null and b/DialogflowCx/metadata/V3/Fulfillment.php differ
diff --git a/DialogflowCx/metadata/V3/Gcs.php b/DialogflowCx/metadata/V3/Gcs.php
new file mode 100644
index 000000000000..de37361c1e26
--- /dev/null
+++ b/DialogflowCx/metadata/V3/Gcs.php
@@ -0,0 +1,30 @@
+internalAddGeneratedFile(
+ '
+
+\'google/cloud/dialogflow/cx/v3/gcs.protogoogle.cloud.dialogflow.cx.v3""
+GcsDestination
+uri ( BAB
+!com.google.cloud.dialogflow.cx.v3BGcsProtoPZ1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpbDFGoogle.Cloud.Dialogflow.Cx.V3!Google::Cloud::Dialogflow::CX::V3bproto3'
+ , true);
+
+ static::$is_initialized = true;
+ }
+}
+
diff --git a/DialogflowCx/metadata/V3/GenerativeSettings.php b/DialogflowCx/metadata/V3/GenerativeSettings.php
new file mode 100644
index 000000000000..192500f29b27
--- /dev/null
+++ b/DialogflowCx/metadata/V3/GenerativeSettings.php
@@ -0,0 +1,49 @@
+internalAddGeneratedFile(
+ '
+
+7google/cloud/dialogflow/cx/v3/generative_settings.protogoogle.cloud.dialogflow.cx.v33google/cloud/dialogflow/cx/v3/safety_settings.proto"
+GenerativeSettings
+name ( ]
+fallback_settings (2B.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettingsQ
+generative_safety_settings (2-.google.cloud.dialogflow.cx.v3.SafetySettingsr
+knowledge_connector_settings (2L.google.cloud.dialogflow.cx.v3.GenerativeSettings.KnowledgeConnectorSettings
+
language_code (
+FallbackSettings
+selected_prompt ( k
+prompt_templates (2Q.google.cloud.dialogflow.cx.v3.GenerativeSettings.FallbackSettings.PromptTemplateK
+PromptTemplate
+display_name (
+prompt_text (
+frozen (
+KnowledgeConnectorSettings
+business (
+agent (
+agent_identity (
+business_description (
+agent_scope ( :A~
+1dialogflow.googleapis.com/AgentGenerativeSettingsIprojects/{project}/locations/{location}/agents/{agent}/generativeSettingsB
+!com.google.cloud.dialogflow.cx.v3BGenerativeSettingsProtoPZ1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpbDFGoogle.Cloud.Dialogflow.Cx.V3!Google::Cloud::Dialogflow::CX::V3bproto3'
+ , true);
+
+ static::$is_initialized = true;
+ }
+}
+
diff --git a/DialogflowCx/metadata/V3/ImportStrategy.php b/DialogflowCx/metadata/V3/ImportStrategy.php
new file mode 100644
index 000000000000..7397ef020c28
Binary files /dev/null and b/DialogflowCx/metadata/V3/ImportStrategy.php differ
diff --git a/DialogflowCx/metadata/V3/Inline.php b/DialogflowCx/metadata/V3/Inline.php
new file mode 100644
index 000000000000..bd34d01f3328
--- /dev/null
+++ b/DialogflowCx/metadata/V3/Inline.php
@@ -0,0 +1,32 @@
+internalAddGeneratedFile(
+ '
+
+*google/cloud/dialogflow/cx/v3/inline.protogoogle.cloud.dialogflow.cx.v3")
+InlineDestination
+content (BA"
+InlineSource
+content (B
+!com.google.cloud.dialogflow.cx.v3BInlineProtoPZ1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpbDFGoogle.Cloud.Dialogflow.Cx.V3!Google::Cloud::Dialogflow::CX::V3bproto3'
+ , true);
+
+ static::$is_initialized = true;
+ }
+}
+
diff --git a/DialogflowCx/metadata/V3/Intent.php b/DialogflowCx/metadata/V3/Intent.php
new file mode 100644
index 000000000000..fb29edffd7a4
Binary files /dev/null and b/DialogflowCx/metadata/V3/Intent.php differ
diff --git a/DialogflowCx/metadata/V3/Page.php b/DialogflowCx/metadata/V3/Page.php
new file mode 100644
index 000000000000..028359f8f9af
Binary files /dev/null and b/DialogflowCx/metadata/V3/Page.php differ
diff --git a/DialogflowCx/metadata/V3/ResponseMessage.php b/DialogflowCx/metadata/V3/ResponseMessage.php
new file mode 100644
index 000000000000..082c2698bdbe
Binary files /dev/null and b/DialogflowCx/metadata/V3/ResponseMessage.php differ
diff --git a/DialogflowCx/metadata/V3/SafetySettings.php b/DialogflowCx/metadata/V3/SafetySettings.php
new file mode 100644
index 000000000000..7942d6ed9aac
--- /dev/null
+++ b/DialogflowCx/metadata/V3/SafetySettings.php
@@ -0,0 +1,33 @@
+internalAddGeneratedFile(
+ '
+
+3google/cloud/dialogflow/cx/v3/safety_settings.protogoogle.cloud.dialogflow.cx.v3"
+SafetySettingsL
+banned_phrases (24.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase7
+Phrase
+text ( BA
+
language_code ( BAB
+!com.google.cloud.dialogflow.cx.v3BSafetySettingsProtoPZ1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpbDFGoogle.Cloud.Dialogflow.Cx.V3!Google::Cloud::Dialogflow::CX::V3bproto3'
+ , true);
+
+ static::$is_initialized = true;
+ }
+}
+
diff --git a/DialogflowCx/metadata/V3/SecuritySettings.php b/DialogflowCx/metadata/V3/SecuritySettings.php
new file mode 100644
index 000000000000..d0ce6b8cb3db
Binary files /dev/null and b/DialogflowCx/metadata/V3/SecuritySettings.php differ
diff --git a/DialogflowCx/metadata/V3/Session.php b/DialogflowCx/metadata/V3/Session.php
new file mode 100644
index 000000000000..2e769f1faefd
Binary files /dev/null and b/DialogflowCx/metadata/V3/Session.php differ
diff --git a/DialogflowCx/metadata/V3/SessionEntityType.php b/DialogflowCx/metadata/V3/SessionEntityType.php
new file mode 100644
index 000000000000..86556bcc348e
Binary files /dev/null and b/DialogflowCx/metadata/V3/SessionEntityType.php differ
diff --git a/DialogflowCx/metadata/V3/TestCase.php b/DialogflowCx/metadata/V3/TestCase.php
new file mode 100644
index 000000000000..fb05d5dffda7
Binary files /dev/null and b/DialogflowCx/metadata/V3/TestCase.php differ
diff --git a/DialogflowCx/metadata/V3/TransitionRouteGroup.php b/DialogflowCx/metadata/V3/TransitionRouteGroup.php
new file mode 100644
index 000000000000..9cf57729a7d1
--- /dev/null
+++ b/DialogflowCx/metadata/V3/TransitionRouteGroup.php
@@ -0,0 +1,70 @@
+internalAddGeneratedFile(
+ '
+
+:google/cloud/dialogflow/cx/v3/transition_route_group.protogoogle.cloud.dialogflow.cx.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto(google/cloud/dialogflow/cx/v3/page.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"
+TransitionRouteGroup
+name (
+display_name ( BAI
+transition_routes (2..google.cloud.dialogflow.cx.v3.TransitionRoute:A
+.dialogflow.googleapis.com/TransitionRouteGrouprprojects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}eprojects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}*transitionRouteGroups2transitionRouteGroup"
+ ListTransitionRouteGroupsRequestF
+parent ( B6AA0.dialogflow.googleapis.com/TransitionRouteGroup
+ page_size (
+
+page_token (
+
language_code ( "
+!ListTransitionRouteGroupsResponseT
+transition_route_groups (23.google.cloud.dialogflow.cx.v3.TransitionRouteGroup
+next_page_token ( "}
+GetTransitionRouteGroupRequestD
+name ( B6AA0
+.dialogflow.googleapis.com/TransitionRouteGroup
+
language_code ( "
+!CreateTransitionRouteGroupRequestF
+parent ( B6AA0.dialogflow.googleapis.com/TransitionRouteGroupX
+transition_route_group (23.google.cloud.dialogflow.cx.v3.TransitionRouteGroupBA
+
language_code ( "
+!UpdateTransitionRouteGroupRequestX
+transition_route_group (23.google.cloud.dialogflow.cx.v3.TransitionRouteGroupBA/
+update_mask (2.google.protobuf.FieldMask
+
language_code ( "x
+!DeleteTransitionRouteGroupRequestD
+name ( B6AA0
+.dialogflow.googleapis.com/TransitionRouteGroup
+force (2
+TransitionRouteGroups
+ListTransitionRouteGroups?.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest@.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse"J/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroupsZDB/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroupsAparent
+GetTransitionRouteGroup=.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest3.google.cloud.dialogflow.cx.v3.TransitionRouteGroup"J/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}ZDB/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}Aname
+CreateTransitionRouteGroup@.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest3.google.cloud.dialogflow.cx.v3.TransitionRouteGroup""J/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups:transition_route_groupZ\\"B/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups:transition_route_groupAparent,transition_route_group
+UpdateTransitionRouteGroup@.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest3.google.cloud.dialogflow.cx.v3.TransitionRouteGroup"2a/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}:transition_route_groupZs2Y/v3/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}:transition_route_groupA"transition_route_group,update_mask
+DeleteTransitionRouteGroup@.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest.google.protobuf.Empty"*J/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}ZD*B/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}AnamexAdialogflow.googleapis.comAYhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB
+!com.google.cloud.dialogflow.cx.v3BTransitionRouteGroupProtoPZ1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpbDFGoogle.Cloud.Dialogflow.Cx.V3!Google::Cloud::Dialogflow::CX::V3bproto3'
+ , true);
+
+ static::$is_initialized = true;
+ }
+}
+
diff --git a/DialogflowCx/metadata/V3/ValidationMessage.php b/DialogflowCx/metadata/V3/ValidationMessage.php
new file mode 100644
index 000000000000..0729931438f1
Binary files /dev/null and b/DialogflowCx/metadata/V3/ValidationMessage.php differ
diff --git a/DialogflowCx/metadata/V3/Version.php b/DialogflowCx/metadata/V3/Version.php
new file mode 100644
index 000000000000..9a11195d2a92
Binary files /dev/null and b/DialogflowCx/metadata/V3/Version.php differ
diff --git a/DialogflowCx/metadata/V3/Webhook.php b/DialogflowCx/metadata/V3/Webhook.php
new file mode 100644
index 000000000000..0de7767e0b03
Binary files /dev/null and b/DialogflowCx/metadata/V3/Webhook.php differ
diff --git a/DialogflowCx/owlbot.py b/DialogflowCx/owlbot.py
new file mode 100644
index 000000000000..bac80b1da66b
--- /dev/null
+++ b/DialogflowCx/owlbot.py
@@ -0,0 +1,62 @@
+# Copyright 2023 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
+#
+# http://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 script is used to synthesize generated parts of this library."""
+
+import logging
+from pathlib import Path
+import subprocess
+
+import synthtool as s
+from synthtool.languages import php
+from synthtool import _tracked_paths
+
+logging.basicConfig(level=logging.DEBUG)
+
+src = Path(f"../{php.STAGING_DIR}/DialogflowCx").resolve()
+dest = Path().resolve()
+
+# Added so that we can pass copy_excludes in the owlbot_main() call
+_tracked_paths.add(src)
+
+php.owlbot_main(
+ src=src,
+ dest=dest,
+ copy_excludes=[
+ src / "**/[A-Z]*_*.php",
+ ]
+)
+
+# remove class_alias code
+s.replace(
+ "src/V*/**/*.php",
+ r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ + "\n"
+ + r"^class_alias\(.*\);$"
+ + "\n",
+ '')
+
+# format generated clients
+subprocess.run([
+ 'npm',
+ 'exec',
+ '--yes',
+ '--package=@prettier/plugin-php@^0.16',
+ '--',
+ 'prettier',
+ '**/BaseClient/*',
+ '--write',
+ '--parser=php',
+ '--single-quote',
+ '--print-width=80'])
diff --git a/DialogflowCx/phpunit.xml.dist b/DialogflowCx/phpunit.xml.dist
new file mode 100644
index 000000000000..6994596fa507
--- /dev/null
+++ b/DialogflowCx/phpunit.xml.dist
@@ -0,0 +1,16 @@
+
+
+
+
+ tests/Unit
+
+
+
+
+ src
+
+ src/V[!a-zA-Z]*
+
+
+
+
diff --git a/DialogflowCx/samples/V3/AgentsClient/create_agent.php b/DialogflowCx/samples/V3/AgentsClient/create_agent.php
new file mode 100644
index 000000000000..ba6981578c17
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/create_agent.php
@@ -0,0 +1,95 @@
+/locations/`. Please see
+ * {@see AgentsClient::locationName()} for help formatting this field.
+ * @param string $agentDisplayName The human-readable name of the agent, unique within the location.
+ * @param string $agentDefaultLanguageCode Immutable. The default language of the agent as a language tag.
+ * See [Language
+ * Support](https://cloud.google.com/dialogflow/cx/docs/reference/language)
+ * for a list of the currently supported language codes.
+ * This field cannot be set by the
+ * [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent]
+ * method.
+ * @param string $agentTimeZone The time zone of the agent from the [time zone
+ * database](https://www.iana.org/time-zones), e.g., America/New_York,
+ * Europe/Paris.
+ */
+function create_agent_sample(
+ string $formattedParent,
+ string $agentDisplayName,
+ string $agentDefaultLanguageCode,
+ string $agentTimeZone
+): void {
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $agent = (new Agent())
+ ->setDisplayName($agentDisplayName)
+ ->setDefaultLanguageCode($agentDefaultLanguageCode)
+ ->setTimeZone($agentTimeZone);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Agent $response */
+ $response = $agentsClient->createAgent($formattedParent, $agent);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = AgentsClient::locationName('[PROJECT]', '[LOCATION]');
+ $agentDisplayName = '[DISPLAY_NAME]';
+ $agentDefaultLanguageCode = '[DEFAULT_LANGUAGE_CODE]';
+ $agentTimeZone = '[TIME_ZONE]';
+
+ create_agent_sample($formattedParent, $agentDisplayName, $agentDefaultLanguageCode, $agentTimeZone);
+}
+// [END dialogflow_v3_generated_Agents_CreateAgent_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/delete_agent.php b/DialogflowCx/samples/V3/AgentsClient/delete_agent.php
new file mode 100644
index 000000000000..9f77bc9c0723
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/delete_agent.php
@@ -0,0 +1,65 @@
+/locations//agents/`. Please see
+ * {@see AgentsClient::agentName()} for help formatting this field.
+ */
+function delete_agent_sample(string $formattedName): void
+{
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $agentsClient->deleteAgent($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = AgentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ delete_agent_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Agents_DeleteAgent_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/export_agent.php b/DialogflowCx/samples/V3/AgentsClient/export_agent.php
new file mode 100644
index 000000000000..d4ef9b3af079
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/export_agent.php
@@ -0,0 +1,88 @@
+/locations//agents/`. Please see
+ * {@see AgentsClient::agentName()} for help formatting this field.
+ */
+function export_agent_sample(string $formattedName): void
+{
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $agentsClient->exportAgent($formattedName);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var ExportAgentResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = AgentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ export_agent_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Agents_ExportAgent_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/get_agent.php b/DialogflowCx/samples/V3/AgentsClient/get_agent.php
new file mode 100644
index 000000000000..c26c6d2c84bf
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/get_agent.php
@@ -0,0 +1,67 @@
+/locations//agents/`. Please see
+ * {@see AgentsClient::agentName()} for help formatting this field.
+ */
+function get_agent_sample(string $formattedName): void
+{
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Agent $response */
+ $response = $agentsClient->getAgent($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = AgentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ get_agent_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Agents_GetAgent_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/get_agent_validation_result.php b/DialogflowCx/samples/V3/AgentsClient/get_agent_validation_result.php
new file mode 100644
index 000000000000..879591653c2c
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/get_agent_validation_result.php
@@ -0,0 +1,69 @@
+/locations//agents//validationResult`. Please see
+ * {@see AgentsClient::agentValidationResultName()} for help formatting this field.
+ */
+function get_agent_validation_result_sample(string $formattedName): void
+{
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var AgentValidationResult $response */
+ $response = $agentsClient->getAgentValidationResult($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = AgentsClient::agentValidationResultName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ get_agent_validation_result_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Agents_GetAgentValidationResult_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/get_generative_settings.php b/DialogflowCx/samples/V3/AgentsClient/get_generative_settings.php
new file mode 100644
index 000000000000..84b5e0045ce3
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/get_generative_settings.php
@@ -0,0 +1,69 @@
+/locations//agents//generativeSettings`. Please see
+ * {@see AgentsClient::agentGenerativeSettingsName()} for help formatting this field.
+ * @param string $languageCode Language code of the generative settings.
+ */
+function get_generative_settings_sample(string $formattedName, string $languageCode): void
+{
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var GenerativeSettings $response */
+ $response = $agentsClient->getGenerativeSettings($formattedName, $languageCode);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = AgentsClient::agentGenerativeSettingsName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $languageCode = '[LANGUAGE_CODE]';
+
+ get_generative_settings_sample($formattedName, $languageCode);
+}
+// [END dialogflow_v3_generated_Agents_GetGenerativeSettings_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/get_location.php b/DialogflowCx/samples/V3/AgentsClient/get_location.php
new file mode 100644
index 000000000000..6d31f74143a6
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Agents_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/list_agents.php b/DialogflowCx/samples/V3/AgentsClient/list_agents.php
new file mode 100644
index 000000000000..988f161c5745
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/list_agents.php
@@ -0,0 +1,72 @@
+/locations/`. Please see
+ * {@see AgentsClient::locationName()} for help formatting this field.
+ */
+function list_agents_sample(string $formattedParent): void
+{
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $agentsClient->listAgents($formattedParent);
+
+ /** @var Agent $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = AgentsClient::locationName('[PROJECT]', '[LOCATION]');
+
+ list_agents_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Agents_ListAgents_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/list_locations.php b/DialogflowCx/samples/V3/AgentsClient/list_locations.php
new file mode 100644
index 000000000000..680ad836190a
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Agents_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/restore_agent.php b/DialogflowCx/samples/V3/AgentsClient/restore_agent.php
new file mode 100644
index 000000000000..3df24506f35a
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/restore_agent.php
@@ -0,0 +1,92 @@
+/locations//agents/`. Please see
+ * {@see AgentsClient::agentName()} for help formatting this field.
+ */
+function restore_agent_sample(string $formattedName): void
+{
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $agentsClient->restoreAgent($formattedName);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ printf('Operation completed successfully.' . PHP_EOL);
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = AgentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ restore_agent_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Agents_RestoreAgent_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/update_agent.php b/DialogflowCx/samples/V3/AgentsClient/update_agent.php
new file mode 100644
index 000000000000..ef947fcb9570
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/update_agent.php
@@ -0,0 +1,90 @@
+setDisplayName($agentDisplayName)
+ ->setDefaultLanguageCode($agentDefaultLanguageCode)
+ ->setTimeZone($agentTimeZone);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Agent $response */
+ $response = $agentsClient->updateAgent($agent);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $agentDisplayName = '[DISPLAY_NAME]';
+ $agentDefaultLanguageCode = '[DEFAULT_LANGUAGE_CODE]';
+ $agentTimeZone = '[TIME_ZONE]';
+
+ update_agent_sample($agentDisplayName, $agentDefaultLanguageCode, $agentTimeZone);
+}
+// [END dialogflow_v3_generated_Agents_UpdateAgent_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/update_generative_settings.php b/DialogflowCx/samples/V3/AgentsClient/update_generative_settings.php
new file mode 100644
index 000000000000..37872104b275
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/update_generative_settings.php
@@ -0,0 +1,56 @@
+updateGenerativeSettings($generativeSettings);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Agents_UpdateGenerativeSettings_sync]
diff --git a/DialogflowCx/samples/V3/AgentsClient/validate_agent.php b/DialogflowCx/samples/V3/AgentsClient/validate_agent.php
new file mode 100644
index 000000000000..7579edfa9a8a
--- /dev/null
+++ b/DialogflowCx/samples/V3/AgentsClient/validate_agent.php
@@ -0,0 +1,69 @@
+/locations//agents/`. Please see
+ * {@see AgentsClient::agentName()} for help formatting this field.
+ */
+function validate_agent_sample(string $formattedName): void
+{
+ // Create a client.
+ $agentsClient = new AgentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var AgentValidationResult $response */
+ $response = $agentsClient->validateAgent($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = AgentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ validate_agent_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Agents_ValidateAgent_sync]
diff --git a/DialogflowCx/samples/V3/ChangelogsClient/get_changelog.php b/DialogflowCx/samples/V3/ChangelogsClient/get_changelog.php
new file mode 100644
index 000000000000..f21eab0ce86b
--- /dev/null
+++ b/DialogflowCx/samples/V3/ChangelogsClient/get_changelog.php
@@ -0,0 +1,73 @@
+/locations//agents//changelogs/`. Please see
+ * {@see ChangelogsClient::changelogName()} for help formatting this field.
+ */
+function get_changelog_sample(string $formattedName): void
+{
+ // Create a client.
+ $changelogsClient = new ChangelogsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Changelog $response */
+ $response = $changelogsClient->getChangelog($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = ChangelogsClient::changelogName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[CHANGELOG]'
+ );
+
+ get_changelog_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Changelogs_GetChangelog_sync]
diff --git a/DialogflowCx/samples/V3/ChangelogsClient/get_location.php b/DialogflowCx/samples/V3/ChangelogsClient/get_location.php
new file mode 100644
index 000000000000..978ba5dbfd10
--- /dev/null
+++ b/DialogflowCx/samples/V3/ChangelogsClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Changelogs_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/ChangelogsClient/list_changelogs.php b/DialogflowCx/samples/V3/ChangelogsClient/list_changelogs.php
new file mode 100644
index 000000000000..caead0cb16a2
--- /dev/null
+++ b/DialogflowCx/samples/V3/ChangelogsClient/list_changelogs.php
@@ -0,0 +1,72 @@
+/locations//agents/`. Please see
+ * {@see ChangelogsClient::agentName()} for help formatting this field.
+ */
+function list_changelogs_sample(string $formattedParent): void
+{
+ // Create a client.
+ $changelogsClient = new ChangelogsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $changelogsClient->listChangelogs($formattedParent);
+
+ /** @var Changelog $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = ChangelogsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ list_changelogs_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Changelogs_ListChangelogs_sync]
diff --git a/DialogflowCx/samples/V3/ChangelogsClient/list_locations.php b/DialogflowCx/samples/V3/ChangelogsClient/list_locations.php
new file mode 100644
index 000000000000..3f818f58406e
--- /dev/null
+++ b/DialogflowCx/samples/V3/ChangelogsClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Changelogs_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/DeploymentsClient/get_deployment.php b/DialogflowCx/samples/V3/DeploymentsClient/get_deployment.php
new file mode 100644
index 000000000000..1a0f6f10dcaa
--- /dev/null
+++ b/DialogflowCx/samples/V3/DeploymentsClient/get_deployment.php
@@ -0,0 +1,76 @@
+/locations//agents//environments//deployments/`. Please see
+ * {@see DeploymentsClient::deploymentName()} for help formatting this field.
+ */
+function get_deployment_sample(string $formattedName): void
+{
+ // Create a client.
+ $deploymentsClient = new DeploymentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Deployment $response */
+ $response = $deploymentsClient->getDeployment($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = DeploymentsClient::deploymentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]',
+ '[DEPLOYMENT]'
+ );
+
+ get_deployment_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Deployments_GetDeployment_sync]
diff --git a/DialogflowCx/samples/V3/DeploymentsClient/get_location.php b/DialogflowCx/samples/V3/DeploymentsClient/get_location.php
new file mode 100644
index 000000000000..232f5f032cb5
--- /dev/null
+++ b/DialogflowCx/samples/V3/DeploymentsClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Deployments_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/DeploymentsClient/list_deployments.php b/DialogflowCx/samples/V3/DeploymentsClient/list_deployments.php
new file mode 100644
index 000000000000..7f21d4bae752
--- /dev/null
+++ b/DialogflowCx/samples/V3/DeploymentsClient/list_deployments.php
@@ -0,0 +1,80 @@
+/locations//agents//environments/`. Please see
+ * {@see DeploymentsClient::environmentName()} for help formatting this field.
+ */
+function list_deployments_sample(string $formattedParent): void
+{
+ // Create a client.
+ $deploymentsClient = new DeploymentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $deploymentsClient->listDeployments($formattedParent);
+
+ /** @var Deployment $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = DeploymentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+
+ list_deployments_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Deployments_ListDeployments_sync]
diff --git a/DialogflowCx/samples/V3/DeploymentsClient/list_locations.php b/DialogflowCx/samples/V3/DeploymentsClient/list_locations.php
new file mode 100644
index 000000000000..dc67996cf9fd
--- /dev/null
+++ b/DialogflowCx/samples/V3/DeploymentsClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Deployments_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/EntityTypesClient/create_entity_type.php b/DialogflowCx/samples/V3/EntityTypesClient/create_entity_type.php
new file mode 100644
index 000000000000..b536ce190972
--- /dev/null
+++ b/DialogflowCx/samples/V3/EntityTypesClient/create_entity_type.php
@@ -0,0 +1,85 @@
+/locations//agents/`. Please see
+ * {@see EntityTypesClient::agentName()} for help formatting this field.
+ * @param string $entityTypeDisplayName The human-readable name of the entity type, unique within the
+ * agent.
+ * @param int $entityTypeKind Indicates the kind of entity type.
+ */
+function create_entity_type_sample(
+ string $formattedParent,
+ string $entityTypeDisplayName,
+ int $entityTypeKind
+): void {
+ // Create a client.
+ $entityTypesClient = new EntityTypesClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $entityType = (new EntityType())
+ ->setDisplayName($entityTypeDisplayName)
+ ->setKind($entityTypeKind);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var EntityType $response */
+ $response = $entityTypesClient->createEntityType($formattedParent, $entityType);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = EntityTypesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $entityTypeDisplayName = '[DISPLAY_NAME]';
+ $entityTypeKind = Kind::KIND_UNSPECIFIED;
+
+ create_entity_type_sample($formattedParent, $entityTypeDisplayName, $entityTypeKind);
+}
+// [END dialogflow_v3_generated_EntityTypes_CreateEntityType_sync]
diff --git a/DialogflowCx/samples/V3/EntityTypesClient/delete_entity_type.php b/DialogflowCx/samples/V3/EntityTypesClient/delete_entity_type.php
new file mode 100644
index 000000000000..a81719d3adc1
--- /dev/null
+++ b/DialogflowCx/samples/V3/EntityTypesClient/delete_entity_type.php
@@ -0,0 +1,75 @@
+/locations//agents//entityTypes/`. Please see
+ * {@see EntityTypesClient::entityTypeName()} for help formatting this field.
+ */
+function delete_entity_type_sample(string $formattedName): void
+{
+ // Create a client.
+ $entityTypesClient = new EntityTypesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $entityTypesClient->deleteEntityType($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = EntityTypesClient::entityTypeName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENTITY_TYPE]'
+ );
+
+ delete_entity_type_sample($formattedName);
+}
+// [END dialogflow_v3_generated_EntityTypes_DeleteEntityType_sync]
diff --git a/DialogflowCx/samples/V3/EntityTypesClient/get_entity_type.php b/DialogflowCx/samples/V3/EntityTypesClient/get_entity_type.php
new file mode 100644
index 000000000000..d4a8dffa6745
--- /dev/null
+++ b/DialogflowCx/samples/V3/EntityTypesClient/get_entity_type.php
@@ -0,0 +1,73 @@
+/locations//agents//entityTypes/`. Please see
+ * {@see EntityTypesClient::entityTypeName()} for help formatting this field.
+ */
+function get_entity_type_sample(string $formattedName): void
+{
+ // Create a client.
+ $entityTypesClient = new EntityTypesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var EntityType $response */
+ $response = $entityTypesClient->getEntityType($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = EntityTypesClient::entityTypeName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENTITY_TYPE]'
+ );
+
+ get_entity_type_sample($formattedName);
+}
+// [END dialogflow_v3_generated_EntityTypes_GetEntityType_sync]
diff --git a/DialogflowCx/samples/V3/EntityTypesClient/get_location.php b/DialogflowCx/samples/V3/EntityTypesClient/get_location.php
new file mode 100644
index 000000000000..ae2e8b85f6a7
--- /dev/null
+++ b/DialogflowCx/samples/V3/EntityTypesClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_EntityTypes_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/EntityTypesClient/list_entity_types.php b/DialogflowCx/samples/V3/EntityTypesClient/list_entity_types.php
new file mode 100644
index 000000000000..b6e450580482
--- /dev/null
+++ b/DialogflowCx/samples/V3/EntityTypesClient/list_entity_types.php
@@ -0,0 +1,72 @@
+/locations//agents/`. Please see
+ * {@see EntityTypesClient::agentName()} for help formatting this field.
+ */
+function list_entity_types_sample(string $formattedParent): void
+{
+ // Create a client.
+ $entityTypesClient = new EntityTypesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $entityTypesClient->listEntityTypes($formattedParent);
+
+ /** @var EntityType $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = EntityTypesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ list_entity_types_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_EntityTypes_ListEntityTypes_sync]
diff --git a/DialogflowCx/samples/V3/EntityTypesClient/list_locations.php b/DialogflowCx/samples/V3/EntityTypesClient/list_locations.php
new file mode 100644
index 000000000000..ab29e47f9445
--- /dev/null
+++ b/DialogflowCx/samples/V3/EntityTypesClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_EntityTypes_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/EntityTypesClient/update_entity_type.php b/DialogflowCx/samples/V3/EntityTypesClient/update_entity_type.php
new file mode 100644
index 000000000000..02f22ac9c07a
--- /dev/null
+++ b/DialogflowCx/samples/V3/EntityTypesClient/update_entity_type.php
@@ -0,0 +1,78 @@
+setDisplayName($entityTypeDisplayName)
+ ->setKind($entityTypeKind);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var EntityType $response */
+ $response = $entityTypesClient->updateEntityType($entityType);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $entityTypeDisplayName = '[DISPLAY_NAME]';
+ $entityTypeKind = Kind::KIND_UNSPECIFIED;
+
+ update_entity_type_sample($entityTypeDisplayName, $entityTypeKind);
+}
+// [END dialogflow_v3_generated_EntityTypes_UpdateEntityType_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/create_environment.php b/DialogflowCx/samples/V3/EnvironmentsClient/create_environment.php
new file mode 100644
index 000000000000..760c9e98cb76
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/create_environment.php
@@ -0,0 +1,96 @@
+/locations//agents/`. Please see
+ * {@see EnvironmentsClient::agentName()} for help formatting this field.
+ * @param string $environmentDisplayName The human-readable name of the environment (unique in an agent).
+ * Limit of 64 characters.
+ */
+function create_environment_sample(string $formattedParent, string $environmentDisplayName): void
+{
+ // Create a client.
+ $environmentsClient = new EnvironmentsClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $environment = (new Environment())
+ ->setDisplayName($environmentDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $environmentsClient->createEnvironment($formattedParent, $environment);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var Environment $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = EnvironmentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $environmentDisplayName = '[DISPLAY_NAME]';
+
+ create_environment_sample($formattedParent, $environmentDisplayName);
+}
+// [END dialogflow_v3_generated_Environments_CreateEnvironment_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/delete_environment.php b/DialogflowCx/samples/V3/EnvironmentsClient/delete_environment.php
new file mode 100644
index 000000000000..67c2166b2dc7
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/delete_environment.php
@@ -0,0 +1,73 @@
+/locations//agents//environments/`. Please see
+ * {@see EnvironmentsClient::environmentName()} for help formatting this field.
+ */
+function delete_environment_sample(string $formattedName): void
+{
+ // Create a client.
+ $environmentsClient = new EnvironmentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $environmentsClient->deleteEnvironment($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = EnvironmentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+
+ delete_environment_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Environments_DeleteEnvironment_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/deploy_flow.php b/DialogflowCx/samples/V3/EnvironmentsClient/deploy_flow.php
new file mode 100644
index 000000000000..57a58eee6cd5
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/deploy_flow.php
@@ -0,0 +1,106 @@
+/locations//agents//
+ * environments/`. Please see
+ * {@see EnvironmentsClient::environmentName()} for help formatting this field.
+ * @param string $formattedFlowVersion The flow version to deploy.
+ * Format: `projects//locations//agents//
+ * flows//versions/`. Please see
+ * {@see EnvironmentsClient::versionName()} for help formatting this field.
+ */
+function deploy_flow_sample(string $formattedEnvironment, string $formattedFlowVersion): void
+{
+ // Create a client.
+ $environmentsClient = new EnvironmentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $environmentsClient->deployFlow($formattedEnvironment, $formattedFlowVersion);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var DeployFlowResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedEnvironment = EnvironmentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+ $formattedFlowVersion = EnvironmentsClient::versionName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[FLOW]',
+ '[VERSION]'
+ );
+
+ deploy_flow_sample($formattedEnvironment, $formattedFlowVersion);
+}
+// [END dialogflow_v3_generated_Environments_DeployFlow_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/get_environment.php b/DialogflowCx/samples/V3/EnvironmentsClient/get_environment.php
new file mode 100644
index 000000000000..5d000f5947e5
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/get_environment.php
@@ -0,0 +1,75 @@
+/locations//agents//environments/`. Please see
+ * {@see EnvironmentsClient::environmentName()} for help formatting this field.
+ */
+function get_environment_sample(string $formattedName): void
+{
+ // Create a client.
+ $environmentsClient = new EnvironmentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Environment $response */
+ $response = $environmentsClient->getEnvironment($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = EnvironmentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+
+ get_environment_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Environments_GetEnvironment_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/get_location.php b/DialogflowCx/samples/V3/EnvironmentsClient/get_location.php
new file mode 100644
index 000000000000..7b5417306553
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Environments_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/list_continuous_test_results.php b/DialogflowCx/samples/V3/EnvironmentsClient/list_continuous_test_results.php
new file mode 100644
index 000000000000..f05df473962e
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/list_continuous_test_results.php
@@ -0,0 +1,78 @@
+/locations//agents//
+ * environments/`. Please see
+ * {@see EnvironmentsClient::environmentName()} for help formatting this field.
+ */
+function list_continuous_test_results_sample(string $formattedParent): void
+{
+ // Create a client.
+ $environmentsClient = new EnvironmentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $environmentsClient->listContinuousTestResults($formattedParent);
+
+ /** @var ContinuousTestResult $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = EnvironmentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+
+ list_continuous_test_results_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Environments_ListContinuousTestResults_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/list_environments.php b/DialogflowCx/samples/V3/EnvironmentsClient/list_environments.php
new file mode 100644
index 000000000000..9591f1a8da7e
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/list_environments.php
@@ -0,0 +1,74 @@
+/locations//agents/`. Please see
+ * {@see EnvironmentsClient::agentName()} for help formatting this field.
+ */
+function list_environments_sample(string $formattedParent): void
+{
+ // Create a client.
+ $environmentsClient = new EnvironmentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $environmentsClient->listEnvironments($formattedParent);
+
+ /** @var Environment $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = EnvironmentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ list_environments_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Environments_ListEnvironments_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/list_locations.php b/DialogflowCx/samples/V3/EnvironmentsClient/list_locations.php
new file mode 100644
index 000000000000..e05ac218a40c
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Environments_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/lookup_environment_history.php b/DialogflowCx/samples/V3/EnvironmentsClient/lookup_environment_history.php
new file mode 100644
index 000000000000..af93b16126bf
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/lookup_environment_history.php
@@ -0,0 +1,79 @@
+/locations//agents//environments/`. Please see
+ * {@see EnvironmentsClient::environmentName()} for help formatting this field.
+ */
+function lookup_environment_history_sample(string $formattedName): void
+{
+ // Create a client.
+ $environmentsClient = new EnvironmentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $environmentsClient->lookupEnvironmentHistory($formattedName);
+
+ /** @var Environment $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = EnvironmentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+
+ lookup_environment_history_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Environments_LookupEnvironmentHistory_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/run_continuous_test.php b/DialogflowCx/samples/V3/EnvironmentsClient/run_continuous_test.php
new file mode 100644
index 000000000000..9387471357fe
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/run_continuous_test.php
@@ -0,0 +1,94 @@
+/locations//agents//environments/`. Please see
+ * {@see EnvironmentsClient::environmentName()} for help formatting this field.
+ */
+function run_continuous_test_sample(string $formattedEnvironment): void
+{
+ // Create a client.
+ $environmentsClient = new EnvironmentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $environmentsClient->runContinuousTest($formattedEnvironment);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var RunContinuousTestResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedEnvironment = EnvironmentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+
+ run_continuous_test_sample($formattedEnvironment);
+}
+// [END dialogflow_v3_generated_Environments_RunContinuousTest_sync]
diff --git a/DialogflowCx/samples/V3/EnvironmentsClient/update_environment.php b/DialogflowCx/samples/V3/EnvironmentsClient/update_environment.php
new file mode 100644
index 000000000000..da86c99f5dcd
--- /dev/null
+++ b/DialogflowCx/samples/V3/EnvironmentsClient/update_environment.php
@@ -0,0 +1,93 @@
+setDisplayName($environmentDisplayName);
+ $updateMask = new FieldMask();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $environmentsClient->updateEnvironment($environment, $updateMask);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var Environment $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $environmentDisplayName = '[DISPLAY_NAME]';
+
+ update_environment_sample($environmentDisplayName);
+}
+// [END dialogflow_v3_generated_Environments_UpdateEnvironment_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/create_experiment.php b/DialogflowCx/samples/V3/ExperimentsClient/create_experiment.php
new file mode 100644
index 000000000000..d8ecc02da010
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/create_experiment.php
@@ -0,0 +1,82 @@
+/locations//agents//environments/`. Please see
+ * {@see ExperimentsClient::environmentName()} for help formatting this field.
+ * @param string $experimentDisplayName The human-readable name of the experiment (unique in an
+ * environment). Limit of 64 characters.
+ */
+function create_experiment_sample(string $formattedParent, string $experimentDisplayName): void
+{
+ // Create a client.
+ $experimentsClient = new ExperimentsClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $experiment = (new Experiment())
+ ->setDisplayName($experimentDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Experiment $response */
+ $response = $experimentsClient->createExperiment($formattedParent, $experiment);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = ExperimentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+ $experimentDisplayName = '[DISPLAY_NAME]';
+
+ create_experiment_sample($formattedParent, $experimentDisplayName);
+}
+// [END dialogflow_v3_generated_Experiments_CreateExperiment_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/delete_experiment.php b/DialogflowCx/samples/V3/ExperimentsClient/delete_experiment.php
new file mode 100644
index 000000000000..dc7eb292055c
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/delete_experiment.php
@@ -0,0 +1,74 @@
+/locations//agents//environments//experiments/`. Please see
+ * {@see ExperimentsClient::experimentName()} for help formatting this field.
+ */
+function delete_experiment_sample(string $formattedName): void
+{
+ // Create a client.
+ $experimentsClient = new ExperimentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $experimentsClient->deleteExperiment($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = ExperimentsClient::experimentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]',
+ '[EXPERIMENT]'
+ );
+
+ delete_experiment_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Experiments_DeleteExperiment_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/get_experiment.php b/DialogflowCx/samples/V3/ExperimentsClient/get_experiment.php
new file mode 100644
index 000000000000..f24aa5b2b73f
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/get_experiment.php
@@ -0,0 +1,76 @@
+/locations//agents//environments//experiments/`. Please see
+ * {@see ExperimentsClient::experimentName()} for help formatting this field.
+ */
+function get_experiment_sample(string $formattedName): void
+{
+ // Create a client.
+ $experimentsClient = new ExperimentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Experiment $response */
+ $response = $experimentsClient->getExperiment($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = ExperimentsClient::experimentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]',
+ '[EXPERIMENT]'
+ );
+
+ get_experiment_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Experiments_GetExperiment_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/get_location.php b/DialogflowCx/samples/V3/ExperimentsClient/get_location.php
new file mode 100644
index 000000000000..2e430e0ab69b
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Experiments_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/list_experiments.php b/DialogflowCx/samples/V3/ExperimentsClient/list_experiments.php
new file mode 100644
index 000000000000..9f38d5cb9bc9
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/list_experiments.php
@@ -0,0 +1,80 @@
+/locations//agents//environments/`. Please see
+ * {@see ExperimentsClient::environmentName()} for help formatting this field.
+ */
+function list_experiments_sample(string $formattedParent): void
+{
+ // Create a client.
+ $experimentsClient = new ExperimentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $experimentsClient->listExperiments($formattedParent);
+
+ /** @var Experiment $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = ExperimentsClient::environmentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]'
+ );
+
+ list_experiments_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Experiments_ListExperiments_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/list_locations.php b/DialogflowCx/samples/V3/ExperimentsClient/list_locations.php
new file mode 100644
index 000000000000..a1e6e4706f69
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Experiments_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/start_experiment.php b/DialogflowCx/samples/V3/ExperimentsClient/start_experiment.php
new file mode 100644
index 000000000000..659118339be9
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/start_experiment.php
@@ -0,0 +1,76 @@
+/locations//agents//environments//experiments/`. Please see
+ * {@see ExperimentsClient::experimentName()} for help formatting this field.
+ */
+function start_experiment_sample(string $formattedName): void
+{
+ // Create a client.
+ $experimentsClient = new ExperimentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Experiment $response */
+ $response = $experimentsClient->startExperiment($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = ExperimentsClient::experimentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]',
+ '[EXPERIMENT]'
+ );
+
+ start_experiment_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Experiments_StartExperiment_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/stop_experiment.php b/DialogflowCx/samples/V3/ExperimentsClient/stop_experiment.php
new file mode 100644
index 000000000000..642c3afc03b4
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/stop_experiment.php
@@ -0,0 +1,75 @@
+/locations//agents//environments//experiments/`. Please see
+ * {@see ExperimentsClient::experimentName()} for help formatting this field.
+ */
+function stop_experiment_sample(string $formattedName): void
+{
+ // Create a client.
+ $experimentsClient = new ExperimentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Experiment $response */
+ $response = $experimentsClient->stopExperiment($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = ExperimentsClient::experimentName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[ENVIRONMENT]',
+ '[EXPERIMENT]'
+ );
+
+ stop_experiment_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Experiments_StopExperiment_sync]
diff --git a/DialogflowCx/samples/V3/ExperimentsClient/update_experiment.php b/DialogflowCx/samples/V3/ExperimentsClient/update_experiment.php
new file mode 100644
index 000000000000..acec26fdcc9f
--- /dev/null
+++ b/DialogflowCx/samples/V3/ExperimentsClient/update_experiment.php
@@ -0,0 +1,73 @@
+setDisplayName($experimentDisplayName);
+ $updateMask = new FieldMask();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Experiment $response */
+ $response = $experimentsClient->updateExperiment($experiment, $updateMask);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $experimentDisplayName = '[DISPLAY_NAME]';
+
+ update_experiment_sample($experimentDisplayName);
+}
+// [END dialogflow_v3_generated_Experiments_UpdateExperiment_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/create_flow.php b/DialogflowCx/samples/V3/FlowsClient/create_flow.php
new file mode 100644
index 000000000000..fab9c1bf749e
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/create_flow.php
@@ -0,0 +1,77 @@
+/locations//agents/`. Please see
+ * {@see FlowsClient::agentName()} for help formatting this field.
+ * @param string $flowDisplayName The human-readable name of the flow.
+ */
+function create_flow_sample(string $formattedParent, string $flowDisplayName): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $flow = (new Flow())
+ ->setDisplayName($flowDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Flow $response */
+ $response = $flowsClient->createFlow($formattedParent, $flow);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = FlowsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $flowDisplayName = '[DISPLAY_NAME]';
+
+ create_flow_sample($formattedParent, $flowDisplayName);
+}
+// [END dialogflow_v3_generated_Flows_CreateFlow_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/delete_flow.php b/DialogflowCx/samples/V3/FlowsClient/delete_flow.php
new file mode 100644
index 000000000000..16b576625873
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/delete_flow.php
@@ -0,0 +1,66 @@
+/locations//agents//flows/`. Please see
+ * {@see FlowsClient::flowName()} for help formatting this field.
+ */
+function delete_flow_sample(string $formattedName): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $flowsClient->deleteFlow($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = FlowsClient::flowName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]');
+
+ delete_flow_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Flows_DeleteFlow_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/export_flow.php b/DialogflowCx/samples/V3/FlowsClient/export_flow.php
new file mode 100644
index 000000000000..5230de34e396
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/export_flow.php
@@ -0,0 +1,92 @@
+/locations//agents//flows/`. Please see
+ * {@see FlowsClient::flowName()} for help formatting this field.
+ */
+function export_flow_sample(string $formattedName): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $flowsClient->exportFlow($formattedName);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var ExportFlowResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = FlowsClient::flowName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]');
+
+ export_flow_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Flows_ExportFlow_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/get_flow.php b/DialogflowCx/samples/V3/FlowsClient/get_flow.php
new file mode 100644
index 000000000000..1e03ef911afd
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/get_flow.php
@@ -0,0 +1,68 @@
+/locations//agents//flows/`. Please see
+ * {@see FlowsClient::flowName()} for help formatting this field.
+ */
+function get_flow_sample(string $formattedName): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Flow $response */
+ $response = $flowsClient->getFlow($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = FlowsClient::flowName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]');
+
+ get_flow_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Flows_GetFlow_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/get_flow_validation_result.php b/DialogflowCx/samples/V3/FlowsClient/get_flow_validation_result.php
new file mode 100644
index 000000000000..e8bf068caa34
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/get_flow_validation_result.php
@@ -0,0 +1,74 @@
+/locations//agents//flows//validationResult`. Please see
+ * {@see FlowsClient::flowValidationResultName()} for help formatting this field.
+ */
+function get_flow_validation_result_sample(string $formattedName): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var FlowValidationResult $response */
+ $response = $flowsClient->getFlowValidationResult($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = FlowsClient::flowValidationResultName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[FLOW]'
+ );
+
+ get_flow_validation_result_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Flows_GetFlowValidationResult_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/get_location.php b/DialogflowCx/samples/V3/FlowsClient/get_location.php
new file mode 100644
index 000000000000..ee4821b62211
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Flows_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/import_flow.php b/DialogflowCx/samples/V3/FlowsClient/import_flow.php
new file mode 100644
index 000000000000..eba189bcb62e
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/import_flow.php
@@ -0,0 +1,92 @@
+/locations//agents/`. Please see
+ * {@see FlowsClient::agentName()} for help formatting this field.
+ */
+function import_flow_sample(string $formattedParent): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $flowsClient->importFlow($formattedParent);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var ImportFlowResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = FlowsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ import_flow_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Flows_ImportFlow_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/list_flows.php b/DialogflowCx/samples/V3/FlowsClient/list_flows.php
new file mode 100644
index 000000000000..b0ac9ad7a078
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/list_flows.php
@@ -0,0 +1,72 @@
+/locations//agents/`. Please see
+ * {@see FlowsClient::agentName()} for help formatting this field.
+ */
+function list_flows_sample(string $formattedParent): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $flowsClient->listFlows($formattedParent);
+
+ /** @var Flow $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = FlowsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ list_flows_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Flows_ListFlows_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/list_locations.php b/DialogflowCx/samples/V3/FlowsClient/list_locations.php
new file mode 100644
index 000000000000..0473daea63ab
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Flows_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/train_flow.php b/DialogflowCx/samples/V3/FlowsClient/train_flow.php
new file mode 100644
index 000000000000..0563d0a6d0a8
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/train_flow.php
@@ -0,0 +1,91 @@
+/locations//agents//flows/`. Please see
+ * {@see FlowsClient::flowName()} for help formatting this field.
+ */
+function train_flow_sample(string $formattedName): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $flowsClient->trainFlow($formattedName);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ printf('Operation completed successfully.' . PHP_EOL);
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = FlowsClient::flowName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]');
+
+ train_flow_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Flows_TrainFlow_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/update_flow.php b/DialogflowCx/samples/V3/FlowsClient/update_flow.php
new file mode 100644
index 000000000000..59e7bd05b0d3
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/update_flow.php
@@ -0,0 +1,73 @@
+setDisplayName($flowDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Flow $response */
+ $response = $flowsClient->updateFlow($flow);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $flowDisplayName = '[DISPLAY_NAME]';
+
+ update_flow_sample($flowDisplayName);
+}
+// [END dialogflow_v3_generated_Flows_UpdateFlow_sync]
diff --git a/DialogflowCx/samples/V3/FlowsClient/validate_flow.php b/DialogflowCx/samples/V3/FlowsClient/validate_flow.php
new file mode 100644
index 000000000000..eafd2bbedfae
--- /dev/null
+++ b/DialogflowCx/samples/V3/FlowsClient/validate_flow.php
@@ -0,0 +1,70 @@
+/locations//agents//flows/`. Please see
+ * {@see FlowsClient::flowName()} for help formatting this field.
+ */
+function validate_flow_sample(string $formattedName): void
+{
+ // Create a client.
+ $flowsClient = new FlowsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var FlowValidationResult $response */
+ $response = $flowsClient->validateFlow($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = FlowsClient::flowName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]');
+
+ validate_flow_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Flows_ValidateFlow_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/create_intent.php b/DialogflowCx/samples/V3/IntentsClient/create_intent.php
new file mode 100644
index 000000000000..8da24bdfca57
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/create_intent.php
@@ -0,0 +1,77 @@
+/locations//agents/`. Please see
+ * {@see IntentsClient::agentName()} for help formatting this field.
+ * @param string $intentDisplayName The human-readable name of the intent, unique within the agent.
+ */
+function create_intent_sample(string $formattedParent, string $intentDisplayName): void
+{
+ // Create a client.
+ $intentsClient = new IntentsClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $intent = (new Intent())
+ ->setDisplayName($intentDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Intent $response */
+ $response = $intentsClient->createIntent($formattedParent, $intent);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = IntentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $intentDisplayName = '[DISPLAY_NAME]';
+
+ create_intent_sample($formattedParent, $intentDisplayName);
+}
+// [END dialogflow_v3_generated_Intents_CreateIntent_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/delete_intent.php b/DialogflowCx/samples/V3/IntentsClient/delete_intent.php
new file mode 100644
index 000000000000..ed3141f0880b
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/delete_intent.php
@@ -0,0 +1,70 @@
+/locations//agents//intents/`. Please see
+ * {@see IntentsClient::intentName()} for help formatting this field.
+ */
+function delete_intent_sample(string $formattedName): void
+{
+ // Create a client.
+ $intentsClient = new IntentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $intentsClient->deleteIntent($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = IntentsClient::intentName('[PROJECT]', '[LOCATION]', '[AGENT]', '[INTENT]');
+
+ delete_intent_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Intents_DeleteIntent_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/export_intents.php b/DialogflowCx/samples/V3/IntentsClient/export_intents.php
new file mode 100644
index 000000000000..705b8787e161
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/export_intents.php
@@ -0,0 +1,96 @@
+/locations//agents/`. Please see
+ * {@see IntentsClient::agentName()} for help formatting this field.
+ * @param string $intentsElement The name of the intents to export.
+ * Format: `projects//locations//agents//intents/`.
+ */
+function export_intents_sample(string $formattedParent, string $intentsElement): void
+{
+ // Create a client.
+ $intentsClient = new IntentsClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $intents = [$intentsElement,];
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $intentsClient->exportIntents($formattedParent, $intents);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var ExportIntentsResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = IntentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $intentsElement = '[INTENTS]';
+
+ export_intents_sample($formattedParent, $intentsElement);
+}
+// [END dialogflow_v3_generated_Intents_ExportIntents_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/get_intent.php b/DialogflowCx/samples/V3/IntentsClient/get_intent.php
new file mode 100644
index 000000000000..dc6ec01f2b9e
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/get_intent.php
@@ -0,0 +1,68 @@
+/locations//agents//intents/`. Please see
+ * {@see IntentsClient::intentName()} for help formatting this field.
+ */
+function get_intent_sample(string $formattedName): void
+{
+ // Create a client.
+ $intentsClient = new IntentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Intent $response */
+ $response = $intentsClient->getIntent($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = IntentsClient::intentName('[PROJECT]', '[LOCATION]', '[AGENT]', '[INTENT]');
+
+ get_intent_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Intents_GetIntent_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/get_location.php b/DialogflowCx/samples/V3/IntentsClient/get_location.php
new file mode 100644
index 000000000000..2bc81b563adc
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Intents_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/import_intents.php b/DialogflowCx/samples/V3/IntentsClient/import_intents.php
new file mode 100644
index 000000000000..b1d85e26f055
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/import_intents.php
@@ -0,0 +1,88 @@
+/locations//agents/`. Please see
+ * {@see IntentsClient::agentName()} for help formatting this field.
+ */
+function import_intents_sample(string $formattedParent): void
+{
+ // Create a client.
+ $intentsClient = new IntentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $intentsClient->importIntents($formattedParent);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var ImportIntentsResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = IntentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ import_intents_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Intents_ImportIntents_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/list_intents.php b/DialogflowCx/samples/V3/IntentsClient/list_intents.php
new file mode 100644
index 000000000000..9580b931ab10
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/list_intents.php
@@ -0,0 +1,72 @@
+/locations//agents/`. Please see
+ * {@see IntentsClient::agentName()} for help formatting this field.
+ */
+function list_intents_sample(string $formattedParent): void
+{
+ // Create a client.
+ $intentsClient = new IntentsClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $intentsClient->listIntents($formattedParent);
+
+ /** @var Intent $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = IntentsClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ list_intents_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Intents_ListIntents_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/list_locations.php b/DialogflowCx/samples/V3/IntentsClient/list_locations.php
new file mode 100644
index 000000000000..01f26c5f5c82
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Intents_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/IntentsClient/update_intent.php b/DialogflowCx/samples/V3/IntentsClient/update_intent.php
new file mode 100644
index 000000000000..da1750837b80
--- /dev/null
+++ b/DialogflowCx/samples/V3/IntentsClient/update_intent.php
@@ -0,0 +1,73 @@
+setDisplayName($intentDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Intent $response */
+ $response = $intentsClient->updateIntent($intent);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $intentDisplayName = '[DISPLAY_NAME]';
+
+ update_intent_sample($intentDisplayName);
+}
+// [END dialogflow_v3_generated_Intents_UpdateIntent_sync]
diff --git a/DialogflowCx/samples/V3/PagesClient/create_page.php b/DialogflowCx/samples/V3/PagesClient/create_page.php
new file mode 100644
index 000000000000..6ec2a046a555
--- /dev/null
+++ b/DialogflowCx/samples/V3/PagesClient/create_page.php
@@ -0,0 +1,78 @@
+/locations//agents//flows/`. Please see
+ * {@see PagesClient::flowName()} for help formatting this field.
+ * @param string $pageDisplayName The human-readable name of the page, unique within the flow.
+ */
+function create_page_sample(string $formattedParent, string $pageDisplayName): void
+{
+ // Create a client.
+ $pagesClient = new PagesClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $page = (new Page())
+ ->setDisplayName($pageDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Page $response */
+ $response = $pagesClient->createPage($formattedParent, $page);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = PagesClient::flowName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]');
+ $pageDisplayName = '[DISPLAY_NAME]';
+
+ create_page_sample($formattedParent, $pageDisplayName);
+}
+// [END dialogflow_v3_generated_Pages_CreatePage_sync]
diff --git a/DialogflowCx/samples/V3/PagesClient/delete_page.php b/DialogflowCx/samples/V3/PagesClient/delete_page.php
new file mode 100644
index 000000000000..8ed6a24fa56f
--- /dev/null
+++ b/DialogflowCx/samples/V3/PagesClient/delete_page.php
@@ -0,0 +1,70 @@
+/locations//agents//Flows//pages/`. Please see
+ * {@see PagesClient::pageName()} for help formatting this field.
+ */
+function delete_page_sample(string $formattedName): void
+{
+ // Create a client.
+ $pagesClient = new PagesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $pagesClient->deletePage($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = PagesClient::pageName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]', '[PAGE]');
+
+ delete_page_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Pages_DeletePage_sync]
diff --git a/DialogflowCx/samples/V3/PagesClient/get_location.php b/DialogflowCx/samples/V3/PagesClient/get_location.php
new file mode 100644
index 000000000000..49c712376b42
--- /dev/null
+++ b/DialogflowCx/samples/V3/PagesClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Pages_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/PagesClient/get_page.php b/DialogflowCx/samples/V3/PagesClient/get_page.php
new file mode 100644
index 000000000000..e6c7069f4c87
--- /dev/null
+++ b/DialogflowCx/samples/V3/PagesClient/get_page.php
@@ -0,0 +1,68 @@
+/locations//agents//flows//pages/`. Please see
+ * {@see PagesClient::pageName()} for help formatting this field.
+ */
+function get_page_sample(string $formattedName): void
+{
+ // Create a client.
+ $pagesClient = new PagesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Page $response */
+ $response = $pagesClient->getPage($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = PagesClient::pageName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]', '[PAGE]');
+
+ get_page_sample($formattedName);
+}
+// [END dialogflow_v3_generated_Pages_GetPage_sync]
diff --git a/DialogflowCx/samples/V3/PagesClient/list_locations.php b/DialogflowCx/samples/V3/PagesClient/list_locations.php
new file mode 100644
index 000000000000..c27c8ea3306a
--- /dev/null
+++ b/DialogflowCx/samples/V3/PagesClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Pages_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/PagesClient/list_pages.php b/DialogflowCx/samples/V3/PagesClient/list_pages.php
new file mode 100644
index 000000000000..86ade7949aa3
--- /dev/null
+++ b/DialogflowCx/samples/V3/PagesClient/list_pages.php
@@ -0,0 +1,73 @@
+/locations//agents//flows/`. Please see
+ * {@see PagesClient::flowName()} for help formatting this field.
+ */
+function list_pages_sample(string $formattedParent): void
+{
+ // Create a client.
+ $pagesClient = new PagesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $pagesClient->listPages($formattedParent);
+
+ /** @var Page $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = PagesClient::flowName('[PROJECT]', '[LOCATION]', '[AGENT]', '[FLOW]');
+
+ list_pages_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_Pages_ListPages_sync]
diff --git a/DialogflowCx/samples/V3/PagesClient/update_page.php b/DialogflowCx/samples/V3/PagesClient/update_page.php
new file mode 100644
index 000000000000..e0c16dbc9d2b
--- /dev/null
+++ b/DialogflowCx/samples/V3/PagesClient/update_page.php
@@ -0,0 +1,73 @@
+setDisplayName($pageDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var Page $response */
+ $response = $pagesClient->updatePage($page);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $pageDisplayName = '[DISPLAY_NAME]';
+
+ update_page_sample($pageDisplayName);
+}
+// [END dialogflow_v3_generated_Pages_UpdatePage_sync]
diff --git a/DialogflowCx/samples/V3/SecuritySettingsServiceClient/create_security_settings.php b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/create_security_settings.php
new file mode 100644
index 000000000000..30b2a7806643
--- /dev/null
+++ b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/create_security_settings.php
@@ -0,0 +1,80 @@
+/locations/`. Please see
+ * {@see SecuritySettingsServiceClient::locationName()} for help formatting this field.
+ * @param string $securitySettingsDisplayName The human-readable name of the security settings, unique within
+ * the location.
+ */
+function create_security_settings_sample(
+ string $formattedParent,
+ string $securitySettingsDisplayName
+): void {
+ // Create a client.
+ $securitySettingsServiceClient = new SecuritySettingsServiceClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $securitySettings = (new SecuritySettings())
+ ->setDisplayName($securitySettingsDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var SecuritySettings $response */
+ $response = $securitySettingsServiceClient->createSecuritySettings(
+ $formattedParent,
+ $securitySettings
+ );
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = SecuritySettingsServiceClient::locationName('[PROJECT]', '[LOCATION]');
+ $securitySettingsDisplayName = '[DISPLAY_NAME]';
+
+ create_security_settings_sample($formattedParent, $securitySettingsDisplayName);
+}
+// [END dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync]
diff --git a/DialogflowCx/samples/V3/SecuritySettingsServiceClient/delete_security_settings.php b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/delete_security_settings.php
new file mode 100644
index 000000000000..8b7b5e3ec991
--- /dev/null
+++ b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/delete_security_settings.php
@@ -0,0 +1,72 @@
+/locations//securitySettings/`. Please see
+ * {@see SecuritySettingsServiceClient::securitySettingsName()} for help formatting this field.
+ */
+function delete_security_settings_sample(string $formattedName): void
+{
+ // Create a client.
+ $securitySettingsServiceClient = new SecuritySettingsServiceClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $securitySettingsServiceClient->deleteSecuritySettings($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = SecuritySettingsServiceClient::securitySettingsName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[SECURITY_SETTINGS]'
+ );
+
+ delete_security_settings_sample($formattedName);
+}
+// [END dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync]
diff --git a/DialogflowCx/samples/V3/SecuritySettingsServiceClient/get_location.php b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/get_location.php
new file mode 100644
index 000000000000..0dcacaefb3ad
--- /dev/null
+++ b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_SecuritySettingsService_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/SecuritySettingsServiceClient/get_security_settings.php b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/get_security_settings.php
new file mode 100644
index 000000000000..0d8d4736a343
--- /dev/null
+++ b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/get_security_settings.php
@@ -0,0 +1,74 @@
+/locations//securitySettings/`. Please see
+ * {@see SecuritySettingsServiceClient::securitySettingsName()} for help formatting this field.
+ */
+function get_security_settings_sample(string $formattedName): void
+{
+ // Create a client.
+ $securitySettingsServiceClient = new SecuritySettingsServiceClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var SecuritySettings $response */
+ $response = $securitySettingsServiceClient->getSecuritySettings($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = SecuritySettingsServiceClient::securitySettingsName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[SECURITY_SETTINGS]'
+ );
+
+ get_security_settings_sample($formattedName);
+}
+// [END dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync]
diff --git a/DialogflowCx/samples/V3/SecuritySettingsServiceClient/list_locations.php b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/list_locations.php
new file mode 100644
index 000000000000..bf4accef8b62
--- /dev/null
+++ b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_SecuritySettingsService_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/SecuritySettingsServiceClient/list_security_settings.php b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/list_security_settings.php
new file mode 100644
index 000000000000..e2342cfeb402
--- /dev/null
+++ b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/list_security_settings.php
@@ -0,0 +1,72 @@
+/locations/`. Please see
+ * {@see SecuritySettingsServiceClient::locationName()} for help formatting this field.
+ */
+function list_security_settings_sample(string $formattedParent): void
+{
+ // Create a client.
+ $securitySettingsServiceClient = new SecuritySettingsServiceClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $securitySettingsServiceClient->listSecuritySettings($formattedParent);
+
+ /** @var SecuritySettings $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = SecuritySettingsServiceClient::locationName('[PROJECT]', '[LOCATION]');
+
+ list_security_settings_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync]
diff --git a/DialogflowCx/samples/V3/SecuritySettingsServiceClient/update_security_settings.php b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/update_security_settings.php
new file mode 100644
index 000000000000..9eb8b5f84a08
--- /dev/null
+++ b/DialogflowCx/samples/V3/SecuritySettingsServiceClient/update_security_settings.php
@@ -0,0 +1,73 @@
+setDisplayName($securitySettingsDisplayName);
+ $updateMask = new FieldMask();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var SecuritySettings $response */
+ $response = $securitySettingsServiceClient->updateSecuritySettings($securitySettings, $updateMask);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $securitySettingsDisplayName = '[DISPLAY_NAME]';
+
+ update_security_settings_sample($securitySettingsDisplayName);
+}
+// [END dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync]
diff --git a/DialogflowCx/samples/V3/SessionEntityTypesClient/create_session_entity_type.php b/DialogflowCx/samples/V3/SessionEntityTypesClient/create_session_entity_type.php
new file mode 100644
index 000000000000..4cccdab488eb
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionEntityTypesClient/create_session_entity_type.php
@@ -0,0 +1,135 @@
+/locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`.
+ * If `Environment ID` is not specified, we assume default 'draft'
+ * environment. Please see
+ * {@see SessionEntityTypesClient::sessionName()} for help formatting this field.
+ * @param string $sessionEntityTypeName The unique identifier of the session entity type.
+ * Format: `projects//locations//agents//sessions//entityTypes/` or `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft'
+ * environment.
+ * @param int $sessionEntityTypeEntityOverrideMode Indicates whether the additional data should override or
+ * supplement the custom entity type definition.
+ * @param string $sessionEntityTypeEntitiesValue The primary value associated with this entity entry.
+ * For example, if the entity type is *vegetable*, the value could be
+ * *scallions*.
+ *
+ * For `KIND_MAP` entity types:
+ *
+ * * A canonical value to be used in place of synonyms.
+ *
+ * For `KIND_LIST` entity types:
+ *
+ * * A string that can contain references to other entity types (with or
+ * without aliases).
+ * @param string $sessionEntityTypeEntitiesSynonymsElement A collection of value synonyms. For example, if the entity type
+ * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+ * onions*.
+ *
+ * For `KIND_LIST` entity types:
+ *
+ * * This collection must contain exactly one synonym equal to `value`.
+ */
+function create_session_entity_type_sample(
+ string $formattedParent,
+ string $sessionEntityTypeName,
+ int $sessionEntityTypeEntityOverrideMode,
+ string $sessionEntityTypeEntitiesValue,
+ string $sessionEntityTypeEntitiesSynonymsElement
+): void {
+ // Create a client.
+ $sessionEntityTypesClient = new SessionEntityTypesClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,];
+ $entity = (new Entity())
+ ->setValue($sessionEntityTypeEntitiesValue)
+ ->setSynonyms($sessionEntityTypeEntitiesSynonyms);
+ $sessionEntityTypeEntities = [$entity,];
+ $sessionEntityType = (new SessionEntityType())
+ ->setName($sessionEntityTypeName)
+ ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode)
+ ->setEntities($sessionEntityTypeEntities);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var SessionEntityType $response */
+ $response = $sessionEntityTypesClient->createSessionEntityType(
+ $formattedParent,
+ $sessionEntityType
+ );
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = SessionEntityTypesClient::sessionName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[SESSION]'
+ );
+ $sessionEntityTypeName = '[NAME]';
+ $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED;
+ $sessionEntityTypeEntitiesValue = '[VALUE]';
+ $sessionEntityTypeEntitiesSynonymsElement = '[SYNONYMS]';
+
+ create_session_entity_type_sample(
+ $formattedParent,
+ $sessionEntityTypeName,
+ $sessionEntityTypeEntityOverrideMode,
+ $sessionEntityTypeEntitiesValue,
+ $sessionEntityTypeEntitiesSynonymsElement
+ );
+}
+// [END dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_sync]
diff --git a/DialogflowCx/samples/V3/SessionEntityTypesClient/delete_session_entity_type.php b/DialogflowCx/samples/V3/SessionEntityTypesClient/delete_session_entity_type.php
new file mode 100644
index 000000000000..f885465342d5
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionEntityTypesClient/delete_session_entity_type.php
@@ -0,0 +1,76 @@
+/locations//agents//sessions//entityTypes/` or
+ * `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft'
+ * environment. Please see
+ * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field.
+ */
+function delete_session_entity_type_sample(string $formattedName): void
+{
+ // Create a client.
+ $sessionEntityTypesClient = new SessionEntityTypesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ $sessionEntityTypesClient->deleteSessionEntityType($formattedName);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = SessionEntityTypesClient::sessionEntityTypeName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[SESSION]',
+ '[ENTITY_TYPE]'
+ );
+
+ delete_session_entity_type_sample($formattedName);
+}
+// [END dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_sync]
diff --git a/DialogflowCx/samples/V3/SessionEntityTypesClient/get_location.php b/DialogflowCx/samples/V3/SessionEntityTypesClient/get_location.php
new file mode 100644
index 000000000000..c598855fc003
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionEntityTypesClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_SessionEntityTypes_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/SessionEntityTypesClient/get_session_entity_type.php b/DialogflowCx/samples/V3/SessionEntityTypesClient/get_session_entity_type.php
new file mode 100644
index 000000000000..b4f5b704c660
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionEntityTypesClient/get_session_entity_type.php
@@ -0,0 +1,78 @@
+/locations//agents//sessions//entityTypes/` or
+ * `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft'
+ * environment. Please see
+ * {@see SessionEntityTypesClient::sessionEntityTypeName()} for help formatting this field.
+ */
+function get_session_entity_type_sample(string $formattedName): void
+{
+ // Create a client.
+ $sessionEntityTypesClient = new SessionEntityTypesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var SessionEntityType $response */
+ $response = $sessionEntityTypesClient->getSessionEntityType($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = SessionEntityTypesClient::sessionEntityTypeName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[SESSION]',
+ '[ENTITY_TYPE]'
+ );
+
+ get_session_entity_type_sample($formattedName);
+}
+// [END dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_sync]
diff --git a/DialogflowCx/samples/V3/SessionEntityTypesClient/list_locations.php b/DialogflowCx/samples/V3/SessionEntityTypesClient/list_locations.php
new file mode 100644
index 000000000000..fa8045a3c9f1
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionEntityTypesClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_SessionEntityTypes_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/SessionEntityTypesClient/list_session_entity_types.php b/DialogflowCx/samples/V3/SessionEntityTypesClient/list_session_entity_types.php
new file mode 100644
index 000000000000..b1dff0ca02c3
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionEntityTypesClient/list_session_entity_types.php
@@ -0,0 +1,81 @@
+/locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`.
+ * If `Environment ID` is not specified, we assume default 'draft'
+ * environment. Please see
+ * {@see SessionEntityTypesClient::sessionName()} for help formatting this field.
+ */
+function list_session_entity_types_sample(string $formattedParent): void
+{
+ // Create a client.
+ $sessionEntityTypesClient = new SessionEntityTypesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $sessionEntityTypesClient->listSessionEntityTypes($formattedParent);
+
+ /** @var SessionEntityType $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = SessionEntityTypesClient::sessionName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[SESSION]'
+ );
+
+ list_session_entity_types_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_sync]
diff --git a/DialogflowCx/samples/V3/SessionEntityTypesClient/update_session_entity_type.php b/DialogflowCx/samples/V3/SessionEntityTypesClient/update_session_entity_type.php
new file mode 100644
index 000000000000..c5a04bbb01ab
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionEntityTypesClient/update_session_entity_type.php
@@ -0,0 +1,117 @@
+/locations//agents//sessions//entityTypes/` or `projects//locations//agents//environments//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft'
+ * environment.
+ * @param int $sessionEntityTypeEntityOverrideMode Indicates whether the additional data should override or
+ * supplement the custom entity type definition.
+ * @param string $sessionEntityTypeEntitiesValue The primary value associated with this entity entry.
+ * For example, if the entity type is *vegetable*, the value could be
+ * *scallions*.
+ *
+ * For `KIND_MAP` entity types:
+ *
+ * * A canonical value to be used in place of synonyms.
+ *
+ * For `KIND_LIST` entity types:
+ *
+ * * A string that can contain references to other entity types (with or
+ * without aliases).
+ * @param string $sessionEntityTypeEntitiesSynonymsElement A collection of value synonyms. For example, if the entity type
+ * is *vegetable*, and `value` is *scallions*, a synonym could be *green
+ * onions*.
+ *
+ * For `KIND_LIST` entity types:
+ *
+ * * This collection must contain exactly one synonym equal to `value`.
+ */
+function update_session_entity_type_sample(
+ string $sessionEntityTypeName,
+ int $sessionEntityTypeEntityOverrideMode,
+ string $sessionEntityTypeEntitiesValue,
+ string $sessionEntityTypeEntitiesSynonymsElement
+): void {
+ // Create a client.
+ $sessionEntityTypesClient = new SessionEntityTypesClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $sessionEntityTypeEntitiesSynonyms = [$sessionEntityTypeEntitiesSynonymsElement,];
+ $entity = (new Entity())
+ ->setValue($sessionEntityTypeEntitiesValue)
+ ->setSynonyms($sessionEntityTypeEntitiesSynonyms);
+ $sessionEntityTypeEntities = [$entity,];
+ $sessionEntityType = (new SessionEntityType())
+ ->setName($sessionEntityTypeName)
+ ->setEntityOverrideMode($sessionEntityTypeEntityOverrideMode)
+ ->setEntities($sessionEntityTypeEntities);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var SessionEntityType $response */
+ $response = $sessionEntityTypesClient->updateSessionEntityType($sessionEntityType);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $sessionEntityTypeName = '[NAME]';
+ $sessionEntityTypeEntityOverrideMode = EntityOverrideMode::ENTITY_OVERRIDE_MODE_UNSPECIFIED;
+ $sessionEntityTypeEntitiesValue = '[VALUE]';
+ $sessionEntityTypeEntitiesSynonymsElement = '[SYNONYMS]';
+
+ update_session_entity_type_sample(
+ $sessionEntityTypeName,
+ $sessionEntityTypeEntityOverrideMode,
+ $sessionEntityTypeEntitiesValue,
+ $sessionEntityTypeEntitiesSynonymsElement
+ );
+}
+// [END dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_sync]
diff --git a/DialogflowCx/samples/V3/SessionsClient/detect_intent.php b/DialogflowCx/samples/V3/SessionsClient/detect_intent.php
new file mode 100644
index 000000000000..4e61757c9581
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionsClient/detect_intent.php
@@ -0,0 +1,98 @@
+/locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`.
+ * If `Environment ID` is not specified, we assume default 'draft'
+ * environment.
+ * It's up to the API caller to choose an appropriate `Session ID`. It can be
+ * a random number or some type of session identifiers (preferably hashed).
+ * The length of the `Session ID` must not exceed 36 characters.
+ *
+ * For more information, see the [sessions
+ * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session).
+ *
+ * Note: Always use agent versions for production traffic.
+ * See [Versions and
+ * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). Please see
+ * {@see SessionsClient::sessionName()} for help formatting this field.
+ * @param string $queryInputLanguageCode The language of the input. See [Language
+ * Support](https://cloud.google.com/dialogflow/cx/docs/reference/language)
+ * for a list of the currently supported language codes. Note that queries in
+ * the same session do not necessarily need to specify the same language.
+ */
+function detect_intent_sample(string $formattedSession, string $queryInputLanguageCode): void
+{
+ // Create a client.
+ $sessionsClient = new SessionsClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $queryInput = (new QueryInput())
+ ->setLanguageCode($queryInputLanguageCode);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var DetectIntentResponse $response */
+ $response = $sessionsClient->detectIntent($formattedSession, $queryInput);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedSession = SessionsClient::sessionName('[PROJECT]', '[LOCATION]', '[AGENT]', '[SESSION]');
+ $queryInputLanguageCode = '[LANGUAGE_CODE]';
+
+ detect_intent_sample($formattedSession, $queryInputLanguageCode);
+}
+// [END dialogflow_v3_generated_Sessions_DetectIntent_sync]
diff --git a/DialogflowCx/samples/V3/SessionsClient/fulfill_intent.php b/DialogflowCx/samples/V3/SessionsClient/fulfill_intent.php
new file mode 100644
index 000000000000..99d06a70da02
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionsClient/fulfill_intent.php
@@ -0,0 +1,59 @@
+fulfillIntent();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Sessions_FulfillIntent_sync]
diff --git a/DialogflowCx/samples/V3/SessionsClient/get_location.php b/DialogflowCx/samples/V3/SessionsClient/get_location.php
new file mode 100644
index 000000000000..f5d5625ccef2
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionsClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Sessions_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/SessionsClient/list_locations.php b/DialogflowCx/samples/V3/SessionsClient/list_locations.php
new file mode 100644
index 000000000000..f1464e5d2e77
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionsClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_Sessions_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/SessionsClient/match_intent.php b/DialogflowCx/samples/V3/SessionsClient/match_intent.php
new file mode 100644
index 000000000000..233acf36a2bc
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionsClient/match_intent.php
@@ -0,0 +1,88 @@
+/locations//agents//sessions/` or `projects//locations//agents//environments//sessions/`.
+ * If `Environment ID` is not specified, we assume default 'draft'
+ * environment.
+ * It's up to the API caller to choose an appropriate `Session ID`. It can be
+ * a random number or some type of session identifiers (preferably hashed).
+ * The length of the `Session ID` must not exceed 36 characters.
+ *
+ * For more information, see the [sessions
+ * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). Please see
+ * {@see SessionsClient::sessionName()} for help formatting this field.
+ * @param string $queryInputLanguageCode The language of the input. See [Language
+ * Support](https://cloud.google.com/dialogflow/cx/docs/reference/language)
+ * for a list of the currently supported language codes. Note that queries in
+ * the same session do not necessarily need to specify the same language.
+ */
+function match_intent_sample(string $formattedSession, string $queryInputLanguageCode): void
+{
+ // Create a client.
+ $sessionsClient = new SessionsClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $queryInput = (new QueryInput())
+ ->setLanguageCode($queryInputLanguageCode);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var MatchIntentResponse $response */
+ $response = $sessionsClient->matchIntent($formattedSession, $queryInput);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedSession = SessionsClient::sessionName('[PROJECT]', '[LOCATION]', '[AGENT]', '[SESSION]');
+ $queryInputLanguageCode = '[LANGUAGE_CODE]';
+
+ match_intent_sample($formattedSession, $queryInputLanguageCode);
+}
+// [END dialogflow_v3_generated_Sessions_MatchIntent_sync]
diff --git a/DialogflowCx/samples/V3/SessionsClient/streaming_detect_intent.php b/DialogflowCx/samples/V3/SessionsClient/streaming_detect_intent.php
new file mode 100644
index 000000000000..e0d917aedff7
--- /dev/null
+++ b/DialogflowCx/samples/V3/SessionsClient/streaming_detect_intent.php
@@ -0,0 +1,88 @@
+setLanguageCode($queryInputLanguageCode);
+ $request = (new StreamingDetectIntentRequest())
+ ->setQueryInput($queryInput);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var BidiStream $stream */
+ $stream = $sessionsClient->streamingDetectIntent();
+ $stream->writeAll([$request,]);
+
+ /** @var StreamingDetectIntentResponse $element */
+ foreach ($stream->closeWriteAndReadAll() as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $queryInputLanguageCode = '[LANGUAGE_CODE]';
+
+ streaming_detect_intent_sample($queryInputLanguageCode);
+}
+// [END dialogflow_v3_generated_Sessions_StreamingDetectIntent_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/batch_delete_test_cases.php b/DialogflowCx/samples/V3/TestCasesClient/batch_delete_test_cases.php
new file mode 100644
index 000000000000..57118005f019
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/batch_delete_test_cases.php
@@ -0,0 +1,79 @@
+/locations//agents/`. Please see
+ * {@see TestCasesClient::agentName()} for help formatting this field.
+ * @param string $formattedNamesElement Format of test case names: `projects//locations/
+ * /agents//testCases/`. Please see
+ * {@see TestCasesClient::testCaseName()} for help formatting this field.
+ */
+function batch_delete_test_cases_sample(
+ string $formattedParent,
+ string $formattedNamesElement
+): void {
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $formattedNames = [$formattedNamesElement,];
+
+ // Call the API and handle any network failures.
+ try {
+ $testCasesClient->batchDeleteTestCases($formattedParent, $formattedNames);
+ printf('Call completed successfully.' . PHP_EOL);
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = TestCasesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $formattedNamesElement = TestCasesClient::testCaseName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[TEST_CASE]'
+ );
+
+ batch_delete_test_cases_sample($formattedParent, $formattedNamesElement);
+}
+// [END dialogflow_v3_generated_TestCases_BatchDeleteTestCases_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/batch_run_test_cases.php b/DialogflowCx/samples/V3/TestCasesClient/batch_run_test_cases.php
new file mode 100644
index 000000000000..2436668c29fd
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/batch_run_test_cases.php
@@ -0,0 +1,102 @@
+/locations//agents/ `. Please see
+ * {@see TestCasesClient::agentName()} for help formatting this field.
+ * @param string $formattedTestCasesElement Format: `projects//locations//agents//testCases/`. Please see
+ * {@see TestCasesClient::testCaseName()} for help formatting this field.
+ */
+function batch_run_test_cases_sample(
+ string $formattedParent,
+ string $formattedTestCasesElement
+): void {
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $formattedTestCases = [$formattedTestCasesElement,];
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $testCasesClient->batchRunTestCases($formattedParent, $formattedTestCases);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var BatchRunTestCasesResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = TestCasesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $formattedTestCasesElement = TestCasesClient::testCaseName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[TEST_CASE]'
+ );
+
+ batch_run_test_cases_sample($formattedParent, $formattedTestCasesElement);
+}
+// [END dialogflow_v3_generated_TestCases_BatchRunTestCases_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/calculate_coverage.php b/DialogflowCx/samples/V3/TestCasesClient/calculate_coverage.php
new file mode 100644
index 000000000000..dc4d206aca34
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/calculate_coverage.php
@@ -0,0 +1,70 @@
+/locations//agents/`. Please see
+ * {@see TestCasesClient::agentName()} for help formatting this field.
+ * @param int $type The type of coverage requested.
+ */
+function calculate_coverage_sample(string $formattedAgent, int $type): void
+{
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var CalculateCoverageResponse $response */
+ $response = $testCasesClient->calculateCoverage($formattedAgent, $type);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedAgent = TestCasesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $type = CoverageType::COVERAGE_TYPE_UNSPECIFIED;
+
+ calculate_coverage_sample($formattedAgent, $type);
+}
+// [END dialogflow_v3_generated_TestCases_CalculateCoverage_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/create_test_case.php b/DialogflowCx/samples/V3/TestCasesClient/create_test_case.php
new file mode 100644
index 000000000000..fe6ca56fc1a0
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/create_test_case.php
@@ -0,0 +1,74 @@
+/locations//agents/`. Please see
+ * {@see TestCasesClient::agentName()} for help formatting this field.
+ * @param string $testCaseDisplayName The human-readable name of the test case, unique within the
+ * agent. Limit of 200 characters.
+ */
+function create_test_case_sample(string $formattedParent, string $testCaseDisplayName): void
+{
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Prepare any non-scalar elements to be passed along with the request.
+ $testCase = (new TestCase())
+ ->setDisplayName($testCaseDisplayName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var TestCase $response */
+ $response = $testCasesClient->createTestCase($formattedParent, $testCase);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = TestCasesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+ $testCaseDisplayName = '[DISPLAY_NAME]';
+
+ create_test_case_sample($formattedParent, $testCaseDisplayName);
+}
+// [END dialogflow_v3_generated_TestCases_CreateTestCase_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/export_test_cases.php b/DialogflowCx/samples/V3/TestCasesClient/export_test_cases.php
new file mode 100644
index 000000000000..525274bfd729
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/export_test_cases.php
@@ -0,0 +1,89 @@
+/locations//agents/`. Please see
+ * {@see TestCasesClient::agentName()} for help formatting this field.
+ */
+function export_test_cases_sample(string $formattedParent): void
+{
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $testCasesClient->exportTestCases($formattedParent);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var ExportTestCasesResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = TestCasesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ export_test_cases_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_TestCases_ExportTestCases_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/get_location.php b/DialogflowCx/samples/V3/TestCasesClient/get_location.php
new file mode 100644
index 000000000000..9bf99a63c293
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/get_location.php
@@ -0,0 +1,53 @@
+getLocation();
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_TestCases_GetLocation_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/get_test_case.php b/DialogflowCx/samples/V3/TestCasesClient/get_test_case.php
new file mode 100644
index 000000000000..a326c128df01
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/get_test_case.php
@@ -0,0 +1,68 @@
+/locations//agents//testCases/`. Please see
+ * {@see TestCasesClient::testCaseName()} for help formatting this field.
+ */
+function get_test_case_sample(string $formattedName): void
+{
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var TestCase $response */
+ $response = $testCasesClient->getTestCase($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = TestCasesClient::testCaseName('[PROJECT]', '[LOCATION]', '[AGENT]', '[TEST_CASE]');
+
+ get_test_case_sample($formattedName);
+}
+// [END dialogflow_v3_generated_TestCases_GetTestCase_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/get_test_case_result.php b/DialogflowCx/samples/V3/TestCasesClient/get_test_case_result.php
new file mode 100644
index 000000000000..633520b18c8e
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/get_test_case_result.php
@@ -0,0 +1,74 @@
+/locations//agents//testCases//results/`. Please see
+ * {@see TestCasesClient::testCaseResultName()} for help formatting this field.
+ */
+function get_test_case_result_sample(string $formattedName): void
+{
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var TestCaseResult $response */
+ $response = $testCasesClient->getTestCaseResult($formattedName);
+ printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedName = TestCasesClient::testCaseResultName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[TEST_CASE]',
+ '[RESULT]'
+ );
+
+ get_test_case_result_sample($formattedName);
+}
+// [END dialogflow_v3_generated_TestCases_GetTestCaseResult_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/import_test_cases.php b/DialogflowCx/samples/V3/TestCasesClient/import_test_cases.php
new file mode 100644
index 000000000000..2a25f7fed38e
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/import_test_cases.php
@@ -0,0 +1,90 @@
+/locations//agents/`. Please see
+ * {@see TestCasesClient::agentName()} for help formatting this field.
+ */
+function import_test_cases_sample(string $formattedParent): void
+{
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var OperationResponse $response */
+ $response = $testCasesClient->importTestCases($formattedParent);
+ $response->pollUntilComplete();
+
+ if ($response->operationSucceeded()) {
+ /** @var ImportTestCasesResponse $result */
+ $result = $response->getResult();
+ printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
+ } else {
+ /** @var Status $error */
+ $error = $response->getError();
+ printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = TestCasesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ import_test_cases_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_TestCases_ImportTestCases_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/list_locations.php b/DialogflowCx/samples/V3/TestCasesClient/list_locations.php
new file mode 100644
index 000000000000..6ea271acf874
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/list_locations.php
@@ -0,0 +1,58 @@
+listLocations();
+
+ /** @var Location $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
+ }
+}
+// [END dialogflow_v3_generated_TestCases_ListLocations_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/list_test_case_results.php b/DialogflowCx/samples/V3/TestCasesClient/list_test_case_results.php
new file mode 100644
index 000000000000..55908883caac
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/list_test_case_results.php
@@ -0,0 +1,80 @@
+/locations//agents//
+ * testCases/`. Specify a `-` as a wildcard for TestCase ID to
+ * list results across multiple test cases. Please see
+ * {@see TestCasesClient::testCaseName()} for help formatting this field.
+ */
+function list_test_case_results_sample(string $formattedParent): void
+{
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $testCasesClient->listTestCaseResults($formattedParent);
+
+ /** @var TestCaseResult $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = TestCasesClient::testCaseName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[AGENT]',
+ '[TEST_CASE]'
+ );
+
+ list_test_case_results_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_TestCases_ListTestCaseResults_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/list_test_cases.php b/DialogflowCx/samples/V3/TestCasesClient/list_test_cases.php
new file mode 100644
index 000000000000..739c0ee9a032
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/list_test_cases.php
@@ -0,0 +1,72 @@
+/locations//agents/`. Please see
+ * {@see TestCasesClient::agentName()} for help formatting this field.
+ */
+function list_test_cases_sample(string $formattedParent): void
+{
+ // Create a client.
+ $testCasesClient = new TestCasesClient();
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $testCasesClient->listTestCases($formattedParent);
+
+ /** @var TestCase $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
+ }
+ } catch (ApiException $ex) {
+ 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
+{
+ $formattedParent = TestCasesClient::agentName('[PROJECT]', '[LOCATION]', '[AGENT]');
+
+ list_test_cases_sample($formattedParent);
+}
+// [END dialogflow_v3_generated_TestCases_ListTestCases_sync]
diff --git a/DialogflowCx/samples/V3/TestCasesClient/run_test_case.php b/DialogflowCx/samples/V3/TestCasesClient/run_test_case.php
new file mode 100644
index 000000000000..a6fb009bd584
--- /dev/null
+++ b/DialogflowCx/samples/V3/TestCasesClient/run_test_case.php
@@ -0,0 +1,88 @@
+/locations/