From e1943fe379a432d4b82c1f08908fc3057dcccd1e Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 20 May 2026 21:06:19 +0000 Subject: [PATCH 1/2] chore(ruby): Configure clients for google-developers-developer_knowledge PiperOrigin-RevId: 918557200 Source-Link: https://github.com/googleapis/googleapis/commit/f4a164aa9daf580d7f434c4004b7c894572f1ab4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5eb047436cd4e155da6401a4397b89f0281a52ae Copy-Tag: eyJwIjoiRGV2ZWxvcGVyc0tub3dsZWRnZS8uT3dsQm90LnlhbWwiLCJoIjoiNWViMDQ3NDM2Y2Q0ZTE1NWRhNjQwMWE0Mzk3Yjg5ZjAyODFhNTJhZSJ9 --- .../Knowledge/V1/Developerknowledge.php | 29 ++ .../Knowledge/V1/BatchGetDocumentsRequest.php | 134 +++++++ .../V1/BatchGetDocumentsResponse.php | 68 ++++ .../Developers/Knowledge/V1/Document.php | 343 ++++++++++++++++++ .../Developers/Knowledge/V1/DocumentChunk.php | 252 +++++++++++++ .../Developers/Knowledge/V1/DocumentView.php | 84 +++++ .../Knowledge/V1/GetDocumentRequest.php | 142 ++++++++ .../V1/SearchDocumentChunksRequest.php | 322 ++++++++++++++++ .../V1/SearchDocumentChunksResponse.php | 138 +++++++ .../batch_get_documents.php | 77 ++++ .../DeveloperKnowledgeClient/get_document.php | 73 ++++ .../search_document_chunks.php | 87 +++++ .../V1/Client/DeveloperKnowledgeClient.php | 336 +++++++++++++++++ .../v1/src/V1/gapic_metadata.json | 33 ++ .../developer_knowledge_client_config.json | 49 +++ .../developer_knowledge_descriptor_config.php | 59 +++ ...developer_knowledge_rest_client_config.php | 48 +++ .../Client/DeveloperKnowledgeClientTest.php | 308 ++++++++++++++++ 18 files changed, 2582 insertions(+) create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsRequest.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsResponse.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/Document.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentChunk.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentView.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/GetDocumentRequest.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksRequest.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksResponse.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php create mode 100644 owl-bot-staging/DevelopersKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php new file mode 100644 index 000000000000..dff02107be60 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + "\x0A\xA6\x12\x0A7google/developers/knowledge/v1/developerknowledge.proto\x12\x1Egoogle.developers.knowledge.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xE0\x02\x0A\x08Document\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x10\x0A\x03uri\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07content\x18\x03 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x04 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdata_source\x18\x05 \x01(\x09B\x03\xE0A\x03\x12\x12\x0A\x05title\x18\x06 \x01(\x09B\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x07 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12?\x0A\x04view\x18\x08 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x03:Z\xEAAW\x0A*developerknowledge.googleapis.com/Document\x12\x14documents/{document}*\x09documents2\x08document\"w\x0A\x1BSearchDocumentChunksRequest\x12\x12\x0A\x05query\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\"|\x0A\x1CSearchDocumentChunksResponse\x12>\x0A\x07results\x18\x01 \x03(\x0B2-.google.developers.knowledge.v1.DocumentChunk\x12\x1C\x0A\x0Fnext_page_token\x18\x02 \x01(\x09B\x03\xE0A\x01\"\x97\x01\x0A\x12GetDocumentRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12?\x0A\x04view\x18\x02 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x01\"\x9E\x01\x0A\x18BatchGetDocumentsRequest\x12A\x0A\x05names\x18\x01 \x03(\x09B2\xE0A\x02\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12?\x0A\x04view\x18\x02 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x01\"X\x0A\x19BatchGetDocumentsResponse\x12;\x0A\x09documents\x18\x01 \x03(\x0B2(.google.developers.knowledge.v1.Document\"\xBB\x01\x0A\x0DDocumentChunk\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x03\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12\x0F\x0A\x02id\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07content\x18\x03 \x01(\x09B\x03\xE0A\x03\x12?\x0A\x08document\x18\x04 \x01(\x0B2(.google.developers.knowledge.v1.DocumentB\x03\xE0A\x03*y\x0A\x0CDocumentView\x12\x1D\x0A\x19DOCUMENT_VIEW_UNSPECIFIED\x10\x00\x12\x17\x0A\x13DOCUMENT_VIEW_BASIC\x10\x01\x12\x16\x0A\x12DOCUMENT_VIEW_FULL\x10\x02\x12\x19\x0A\x15DOCUMENT_VIEW_CONTENT\x10\x032\xEC\x04\x0A\x12DeveloperKnowledge\x12\xBD\x01\x0A\x14SearchDocumentChunks\x12;.google.developers.knowledge.v1.SearchDocumentChunksRequest\x1A<.google.developers.knowledge.v1.SearchDocumentChunksResponse\"*\x82\xD3\xE4\x93\x02\$\x12\"/v1/documents:searchDocumentChunks\x12\x93\x01\x0A\x0BGetDocument\x122.google.developers.knowledge.v1.GetDocumentRequest\x1A(.google.developers.knowledge.v1.Document\"&\xDAA\x04name\x82\xD3\xE4\x93\x02\x19\x12\x17/v1/{name=documents/**}\x12\xA8\x01\x0A\x11BatchGetDocuments\x128.google.developers.knowledge.v1.BatchGetDocumentsRequest\x1A9.google.developers.knowledge.v1.BatchGetDocumentsResponse\"\x1E\x82\xD3\xE4\x93\x02\x18\x12\x16/v1/documents:batchGet\x1AU\xCAA!developerknowledge.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xB5\x01\x0A\"com.google.developers.knowledge.v1B\x17DeveloperKnowledgeProtoP\x01ZGgoogle.golang.org/genproto/googleapis/developers/knowledge/v1;knowledge\xEA\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsRequest.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsRequest.php new file mode 100644 index 000000000000..535c5d13f7a7 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsRequest.php @@ -0,0 +1,134 @@ +google.developers.knowledge.v1.BatchGetDocumentsRequest + */ +class BatchGetDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specifies the names of the documents to retrieve. A maximum of 20 + * documents can be retrieved in a batch. The documents are returned in the + * same order as the `names` in the request. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $names; + /** + * Optional. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. If unspecified, + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * defaults to `DOCUMENT_VIEW_CONTENT`. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $names + * Required. Specifies the names of the documents to retrieve. A maximum of 20 + * documents can be retrieved in a batch. The documents are returned in the + * same order as the `names` in the request. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * @type int $view + * Optional. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. If unspecified, + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * defaults to `DOCUMENT_VIEW_CONTENT`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specifies the names of the documents to retrieve. A maximum of 20 + * documents can be retrieved in a batch. The documents are returned in the + * same order as the `names` in the request. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return RepeatedField + */ + public function getNames() + { + return $this->names; + } + + /** + * Required. Specifies the names of the documents to retrieve. A maximum of 20 + * documents can be retrieved in a batch. The documents are returned in the + * same order as the `names` in the request. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string[] $var + * @return $this + */ + public function setNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->names = $arr; + + return $this; + } + + /** + * Optional. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. If unspecified, + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * defaults to `DOCUMENT_VIEW_CONTENT`. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. If unspecified, + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * defaults to `DOCUMENT_VIEW_CONTENT`. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Developers\Knowledge\V1\DocumentView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsResponse.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsResponse.php new file mode 100644 index 000000000000..9352f4a5dab9 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsResponse.php @@ -0,0 +1,68 @@ +google.developers.knowledge.v1.BatchGetDocumentsResponse + */ +class BatchGetDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Contains the documents requested. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Document documents = 1; + */ + private $documents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Developers\Knowledge\V1\Document[] $documents + * Contains the documents requested. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Contains the documents requested. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Document documents = 1; + * @return RepeatedField<\Google\Developers\Knowledge\V1\Document> + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * Contains the documents requested. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Document documents = 1; + * @param \Google\Developers\Knowledge\V1\Document[] $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\Knowledge\V1\Document::class); + $this->documents = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/Document.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/Document.php new file mode 100644 index 000000000000..e1e933a323ee --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/Document.php @@ -0,0 +1,343 @@ +google.developers.knowledge.v1.Document + */ +class Document extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Contains the resource name of the document. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Provides the URI of the content, such as + * `docs.cloud.google.com/storage/docs/creating-buckets`. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uri = ''; + /** + * Output only. Contains the full content of the document in Markdown format. + * + * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $content = ''; + /** + * Output only. Provides a description of the document. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. Specifies the data source of the document. + * Example data source: `firebase.google.com` + * + * Generated from protobuf field string data_source = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_source = ''; + /** + * Output only. Provides the title of the document. + * + * Generated from protobuf field string title = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $title = ''; + /** + * Output only. Represents the timestamp when the content or metadata of the + * document was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Contains the resource name of the document. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * @type string $uri + * Output only. Provides the URI of the content, such as + * `docs.cloud.google.com/storage/docs/creating-buckets`. + * @type string $content + * Output only. Contains the full content of the document in Markdown format. + * @type string $description + * Output only. Provides a description of the document. + * @type string $data_source + * Output only. Specifies the data source of the document. + * Example data source: `firebase.google.com` + * @type string $title + * Output only. Provides the title of the document. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Represents the timestamp when the content or metadata of the + * document was last updated. + * @type int $view + * Output only. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Contains the resource name of the document. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Contains the resource name of the document. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Provides the URI of the content, such as + * `docs.cloud.google.com/storage/docs/creating-buckets`. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Output only. Provides the URI of the content, such as + * `docs.cloud.google.com/storage/docs/creating-buckets`. + * + * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Output only. Contains the full content of the document in Markdown format. + * + * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Output only. Contains the full content of the document in Markdown format. + * + * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Output only. Provides a description of the document. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. Provides a description of the document. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Specifies the data source of the document. + * Example data source: `firebase.google.com` + * + * Generated from protobuf field string data_source = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDataSource() + { + return $this->data_source; + } + + /** + * Output only. Specifies the data source of the document. + * Example data source: `firebase.google.com` + * + * Generated from protobuf field string data_source = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkString($var, True); + $this->data_source = $var; + + return $this; + } + + /** + * Output only. Provides the title of the document. + * + * Generated from protobuf field string title = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Output only. Provides the title of the document. + * + * Generated from protobuf field string title = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Output only. Represents the timestamp when the content or metadata of the + * document was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Represents the timestamp when the content or metadata of the + * document was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Output only. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Developers\Knowledge\V1\DocumentView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentChunk.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentChunk.php new file mode 100644 index 000000000000..e8895fa575a3 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentChunk.php @@ -0,0 +1,252 @@ +google.developers.knowledge.v1.DocumentChunk + */ +class DocumentChunk extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Contains the resource name of the document this chunk is from. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Output only. Specifies the ID of this chunk within the document. The chunk + * ID is unique within a document, but not globally unique across documents. + * The chunk ID is not stable and may change over time. + * + * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * Output only. Contains the content of the document chunk. + * + * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $content = ''; + /** + * Output only. Represents metadata about the + * [Document][google.developers.knowledge.v1.Document] this chunk is from. The + * [DocumentView][google.developers.knowledge.v1.DocumentView] of this + * [Document][google.developers.knowledge.v1.Document] message will be set to + * `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients + * do not need to call + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * if they only need the metadata fields. Otherwise, clients should use + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * to fetch the full document content. + * + * Generated from protobuf field .google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $document = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Output only. Contains the resource name of the document this chunk is from. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * @type string $id + * Output only. Specifies the ID of this chunk within the document. The chunk + * ID is unique within a document, but not globally unique across documents. + * The chunk ID is not stable and may change over time. + * @type string $content + * Output only. Contains the content of the document chunk. + * @type \Google\Developers\Knowledge\V1\Document $document + * Output only. Represents metadata about the + * [Document][google.developers.knowledge.v1.Document] this chunk is from. The + * [DocumentView][google.developers.knowledge.v1.DocumentView] of this + * [Document][google.developers.knowledge.v1.Document] message will be set to + * `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients + * do not need to call + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * if they only need the metadata fields. Otherwise, clients should use + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * to fetch the full document content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Contains the resource name of the document this chunk is from. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Output only. Contains the resource name of the document this chunk is from. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Output only. Specifies the ID of this chunk within the document. The chunk + * ID is unique within a document, but not globally unique across documents. + * The chunk ID is not stable and may change over time. + * + * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. Specifies the ID of this chunk within the document. The chunk + * ID is unique within a document, but not globally unique across documents. + * The chunk ID is not stable and may change over time. + * + * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Output only. Contains the content of the document chunk. + * + * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Output only. Contains the content of the document chunk. + * + * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Output only. Represents metadata about the + * [Document][google.developers.knowledge.v1.Document] this chunk is from. The + * [DocumentView][google.developers.knowledge.v1.DocumentView] of this + * [Document][google.developers.knowledge.v1.Document] message will be set to + * `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients + * do not need to call + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * if they only need the metadata fields. Otherwise, clients should use + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * to fetch the full document content. + * + * Generated from protobuf field .google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Developers\Knowledge\V1\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * Output only. Represents metadata about the + * [Document][google.developers.knowledge.v1.Document] this chunk is from. The + * [DocumentView][google.developers.knowledge.v1.DocumentView] of this + * [Document][google.developers.knowledge.v1.Document] message will be set to + * `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients + * do not need to call + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * if they only need the metadata fields. Otherwise, clients should use + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * to fetch the full document content. + * + * Generated from protobuf field .google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Developers\Knowledge\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Developers\Knowledge\V1\Document::class); + $this->document = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentView.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentView.php new file mode 100644 index 000000000000..72939ed3075e --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentView.php @@ -0,0 +1,84 @@ +google.developers.knowledge.v1.DocumentView + */ +class DocumentView +{ + /** + * The default / unset value. See each API method for its default value if + * [DocumentView][google.developers.knowledge.v1.DocumentView] is not + * specified. + * + * Generated from protobuf enum DOCUMENT_VIEW_UNSPECIFIED = 0; + */ + const DOCUMENT_VIEW_UNSPECIFIED = 0; + /** + * Includes only the basic metadata fields: + * - `name` + * - `uri` + * - `data_source` + * - `title` + * - `description` + * - `update_time` + * - `view` + * This is the default of view for + * [DeveloperKnowledge.SearchDocumentChunks][google.developers.knowledge.v1.DeveloperKnowledge.SearchDocumentChunks]. + * + * Generated from protobuf enum DOCUMENT_VIEW_BASIC = 1; + */ + const DOCUMENT_VIEW_BASIC = 1; + /** + * Includes all [Document][google.developers.knowledge.v1.Document] fields. + * + * Generated from protobuf enum DOCUMENT_VIEW_FULL = 2; + */ + const DOCUMENT_VIEW_FULL = 2; + /** + * Includes the `DOCUMENT_VIEW_BASIC` fields and the `content` field. + * This is the default of view for + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * and + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]. + * + * Generated from protobuf enum DOCUMENT_VIEW_CONTENT = 3; + */ + const DOCUMENT_VIEW_CONTENT = 3; + + private static $valueToName = [ + self::DOCUMENT_VIEW_UNSPECIFIED => 'DOCUMENT_VIEW_UNSPECIFIED', + self::DOCUMENT_VIEW_BASIC => 'DOCUMENT_VIEW_BASIC', + self::DOCUMENT_VIEW_FULL => 'DOCUMENT_VIEW_FULL', + self::DOCUMENT_VIEW_CONTENT => 'DOCUMENT_VIEW_CONTENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/GetDocumentRequest.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/GetDocumentRequest.php new file mode 100644 index 000000000000..2b4ce5f16d9e --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/GetDocumentRequest.php @@ -0,0 +1,142 @@ +google.developers.knowledge.v1.GetDocumentRequest + */ +class GetDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specifies the name of the document to retrieve. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. If unspecified, + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * defaults to `DOCUMENT_VIEW_CONTENT`. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $name Required. Specifies the name of the document to retrieve. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * Please see {@see DeveloperKnowledgeClient::documentName()} for help formatting this field. + * + * @return \Google\Developers\Knowledge\V1\GetDocumentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Specifies the name of the document to retrieve. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * @type int $view + * Optional. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. If unspecified, + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * defaults to `DOCUMENT_VIEW_CONTENT`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specifies the name of the document to retrieve. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Specifies the name of the document to retrieve. + * Format: `documents/{uri_without_scheme}` + * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. If unspecified, + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * defaults to `DOCUMENT_VIEW_CONTENT`. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Specifies the + * [DocumentView][google.developers.knowledge.v1.DocumentView] of the + * document. If unspecified, + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * defaults to `DOCUMENT_VIEW_CONTENT`. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Developers\Knowledge\V1\DocumentView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksRequest.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksRequest.php new file mode 100644 index 000000000000..a4e8912ce468 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksRequest.php @@ -0,0 +1,322 @@ +google.developers.knowledge.v1.SearchDocumentChunksRequest + */ +class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Provides the raw query string provided by the user, such as "How + * to create a Cloud Storage bucket?". + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + /** + * Optional. Specifies the maximum number of results to return. The service + * may return fewer than this value. + * If unspecified, at most 5 results will be returned. + * The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT + * error. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Contains a page token, received from a previous + * `SearchDocumentChunks` call. Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Applies a strict filter to the search results. The expression + * supports a subset of the syntax described at https://google.aip.dev/160. + * While `SearchDocumentChunks` returns + * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter + * is applied to `DocumentChunk.document` fields. + * Supported fields for filtering: + * * `data_source` (STRING): The source of the document, e.g. + * `docs.cloud.google.com`. See + * https://developers.google.com/knowledge/reference/corpus-reference for + * the complete list of data sources in the corpus. + * * `update_time` (TIMESTAMP): The timestamp of when the document was last + * meaningfully updated. A meaningful update is one that changes document's + * markdown content or metadata. + * * `uri` (STRING): The document URI, e.g. + * `https://docs.cloud.google.com/bigquery/docs/tables`. + * STRING fields support `=` (equals) and `!=` (not equals) operators for + * **exact match** on the whole string. Partial match, prefix match, and + * regexp match are not supported. + * TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. + * Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. + * You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical + * operators. `OR` has higher precedence than `AND`. Use parentheses for + * explicit precedence grouping. + * Examples: + * * `data_source = "docs.cloud.google.com" OR data_source = + * "firebase.google.com"` + * * `data_source != "firebase.google.com"` + * * `update_time < "2024-01-01T00:00:00Z"` + * * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = + * "developer.chrome.com" OR data_source = "web.dev")` + * * `uri = "https://docs.cloud.google.com/release-notes"` + * The `filter` string must not exceed 500 characters; values longer than 500 + * characters will result in an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * Required. Provides the raw query string provided by the user, such as "How + * to create a Cloud Storage bucket?". + * @type int $page_size + * Optional. Specifies the maximum number of results to return. The service + * may return fewer than this value. + * If unspecified, at most 5 results will be returned. + * The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT + * error. + * @type string $page_token + * Optional. Contains a page token, received from a previous + * `SearchDocumentChunks` call. Provide this to retrieve the subsequent page. + * @type string $filter + * Optional. Applies a strict filter to the search results. The expression + * supports a subset of the syntax described at https://google.aip.dev/160. + * While `SearchDocumentChunks` returns + * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter + * is applied to `DocumentChunk.document` fields. + * Supported fields for filtering: + * * `data_source` (STRING): The source of the document, e.g. + * `docs.cloud.google.com`. See + * https://developers.google.com/knowledge/reference/corpus-reference for + * the complete list of data sources in the corpus. + * * `update_time` (TIMESTAMP): The timestamp of when the document was last + * meaningfully updated. A meaningful update is one that changes document's + * markdown content or metadata. + * * `uri` (STRING): The document URI, e.g. + * `https://docs.cloud.google.com/bigquery/docs/tables`. + * STRING fields support `=` (equals) and `!=` (not equals) operators for + * **exact match** on the whole string. Partial match, prefix match, and + * regexp match are not supported. + * TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. + * Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. + * You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical + * operators. `OR` has higher precedence than `AND`. Use parentheses for + * explicit precedence grouping. + * Examples: + * * `data_source = "docs.cloud.google.com" OR data_source = + * "firebase.google.com"` + * * `data_source != "firebase.google.com"` + * * `update_time < "2024-01-01T00:00:00Z"` + * * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = + * "developer.chrome.com" OR data_source = "web.dev")` + * * `uri = "https://docs.cloud.google.com/release-notes"` + * The `filter` string must not exceed 500 characters; values longer than 500 + * characters will result in an `INVALID_ARGUMENT` error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Required. Provides the raw query string provided by the user, such as "How + * to create a Cloud Storage bucket?". + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. Provides the raw query string provided by the user, such as "How + * to create a Cloud Storage bucket?". + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * Optional. Specifies the maximum number of results to return. The service + * may return fewer than this value. + * If unspecified, at most 5 results will be returned. + * The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT + * error. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Specifies the maximum number of results to return. The service + * may return fewer than this value. + * If unspecified, at most 5 results will be returned. + * The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT + * error. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Contains a page token, received from a previous + * `SearchDocumentChunks` call. Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Contains a page token, received from a previous + * `SearchDocumentChunks` call. Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Applies a strict filter to the search results. The expression + * supports a subset of the syntax described at https://google.aip.dev/160. + * While `SearchDocumentChunks` returns + * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter + * is applied to `DocumentChunk.document` fields. + * Supported fields for filtering: + * * `data_source` (STRING): The source of the document, e.g. + * `docs.cloud.google.com`. See + * https://developers.google.com/knowledge/reference/corpus-reference for + * the complete list of data sources in the corpus. + * * `update_time` (TIMESTAMP): The timestamp of when the document was last + * meaningfully updated. A meaningful update is one that changes document's + * markdown content or metadata. + * * `uri` (STRING): The document URI, e.g. + * `https://docs.cloud.google.com/bigquery/docs/tables`. + * STRING fields support `=` (equals) and `!=` (not equals) operators for + * **exact match** on the whole string. Partial match, prefix match, and + * regexp match are not supported. + * TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. + * Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. + * You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical + * operators. `OR` has higher precedence than `AND`. Use parentheses for + * explicit precedence grouping. + * Examples: + * * `data_source = "docs.cloud.google.com" OR data_source = + * "firebase.google.com"` + * * `data_source != "firebase.google.com"` + * * `update_time < "2024-01-01T00:00:00Z"` + * * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = + * "developer.chrome.com" OR data_source = "web.dev")` + * * `uri = "https://docs.cloud.google.com/release-notes"` + * The `filter` string must not exceed 500 characters; values longer than 500 + * characters will result in an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Applies a strict filter to the search results. The expression + * supports a subset of the syntax described at https://google.aip.dev/160. + * While `SearchDocumentChunks` returns + * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter + * is applied to `DocumentChunk.document` fields. + * Supported fields for filtering: + * * `data_source` (STRING): The source of the document, e.g. + * `docs.cloud.google.com`. See + * https://developers.google.com/knowledge/reference/corpus-reference for + * the complete list of data sources in the corpus. + * * `update_time` (TIMESTAMP): The timestamp of when the document was last + * meaningfully updated. A meaningful update is one that changes document's + * markdown content or metadata. + * * `uri` (STRING): The document URI, e.g. + * `https://docs.cloud.google.com/bigquery/docs/tables`. + * STRING fields support `=` (equals) and `!=` (not equals) operators for + * **exact match** on the whole string. Partial match, prefix match, and + * regexp match are not supported. + * TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. + * Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. + * You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical + * operators. `OR` has higher precedence than `AND`. Use parentheses for + * explicit precedence grouping. + * Examples: + * * `data_source = "docs.cloud.google.com" OR data_source = + * "firebase.google.com"` + * * `data_source != "firebase.google.com"` + * * `update_time < "2024-01-01T00:00:00Z"` + * * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = + * "developer.chrome.com" OR data_source = "web.dev")` + * * `uri = "https://docs.cloud.google.com/release-notes"` + * The `filter` string must not exceed 500 characters; values longer than 500 + * characters will result in an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksResponse.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksResponse.php new file mode 100644 index 000000000000..0e0a7dca389b --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksResponse.php @@ -0,0 +1,138 @@ +google.developers.knowledge.v1.SearchDocumentChunksResponse + */ +class SearchDocumentChunksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Contains the search results for the given query. Each + * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list + * contains a snippet of content relevant to the search query. Use the + * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] + * field of each result with + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * to retrieve the full document content. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.DocumentChunk results = 1; + */ + private $results; + /** + * Optional. Provides a token that can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Developers\Knowledge\V1\DocumentChunk[] $results + * Contains the search results for the given query. Each + * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list + * contains a snippet of content relevant to the search query. Use the + * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] + * field of each result with + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * to retrieve the full document content. + * @type string $next_page_token + * Optional. Provides a token that can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Contains the search results for the given query. Each + * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list + * contains a snippet of content relevant to the search query. Use the + * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] + * field of each result with + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * to retrieve the full document content. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.DocumentChunk results = 1; + * @return RepeatedField<\Google\Developers\Knowledge\V1\DocumentChunk> + */ + public function getResults() + { + return $this->results; + } + + /** + * Contains the search results for the given query. Each + * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list + * contains a snippet of content relevant to the search query. Use the + * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] + * field of each result with + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * to retrieve the full document content. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.DocumentChunk results = 1; + * @param \Google\Developers\Knowledge\V1\DocumentChunk[] $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\Knowledge\V1\DocumentChunk::class); + $this->results = $arr; + + return $this; + } + + /** + * Optional. Provides a token that can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Optional. Provides a token that can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php new file mode 100644 index 000000000000..c1f4812761d5 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php @@ -0,0 +1,77 @@ +setNames($formattedNames); + + // Call the API and handle any network failures. + try { + /** @var BatchGetDocumentsResponse $response */ + $response = $developerKnowledgeClient->batchGetDocuments($request); + 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 +{ + $formattedNamesElement = DeveloperKnowledgeClient::documentName('[DOCUMENT]'); + + batch_get_documents_sample($formattedNamesElement); +} +// [END developerknowledge_v1_generated_DeveloperKnowledge_BatchGetDocuments_sync] diff --git a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php new file mode 100644 index 000000000000..9564343c9bc5 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Document $response */ + $response = $developerKnowledgeClient->getDocument($request); + 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 = DeveloperKnowledgeClient::documentName('[DOCUMENT]'); + + get_document_sample($formattedName); +} +// [END developerknowledge_v1_generated_DeveloperKnowledge_GetDocument_sync] diff --git a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php new file mode 100644 index 000000000000..6eea019ba96a --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php @@ -0,0 +1,87 @@ +setQuery($query); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerKnowledgeClient->searchDocumentChunks($request); + + /** @var DocumentChunk $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 +{ + $query = '[QUERY]'; + + search_document_chunks_sample($query); +} +// [END developerknowledge_v1_generated_DeveloperKnowledge_SearchDocumentChunks_sync] diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php new file mode 100644 index 000000000000..27909f31fad0 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php @@ -0,0 +1,336 @@ + batchGetDocumentsAsync(BatchGetDocumentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDocumentAsync(GetDocumentRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchDocumentChunksAsync(SearchDocumentChunksRequest $request, array $optionalArgs = []) + */ +final class DeveloperKnowledgeClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.developers.knowledge.v1.DeveloperKnowledge'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'developerknowledge.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'developerknowledge.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/developer_knowledge_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/developer_knowledge_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/developer_knowledge_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/developer_knowledge_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a document + * resource. + * + * @param string $document + * + * @return string The formatted document resource. + */ + public static function documentName(string $document): string + { + return self::getPathTemplate('document')->render([ + 'document' => $document, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - document: documents/{document} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'developerknowledge.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Developers\Knowledge\V1\DeveloperKnowledgeClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new DeveloperKnowledgeClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves multiple documents, each with its full Markdown content. + * + * The async variant is {@see DeveloperKnowledgeClient::batchGetDocumentsAsync()} . + * + * @example samples/V1/DeveloperKnowledgeClient/batch_get_documents.php + * + * @param BatchGetDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BatchGetDocumentsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchGetDocuments(BatchGetDocumentsRequest $request, array $callOptions = []): BatchGetDocumentsResponse + { + return $this->startApiCall('BatchGetDocuments', $request, $callOptions)->wait(); + } + + /** + * Retrieves a single document with its full Markdown content. + * + * The async variant is {@see DeveloperKnowledgeClient::getDocumentAsync()} . + * + * @example samples/V1/DeveloperKnowledgeClient/get_document.php + * + * @param GetDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Document + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDocument(GetDocumentRequest $request, array $callOptions = []): Document + { + return $this->startApiCall('GetDocument', $request, $callOptions)->wait(); + } + + /** + * Searches for developer knowledge across Google's developer documentation. + * Returns [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s + * based on the user's query. There may be many chunks from the same + * [Document][google.developers.knowledge.v1.Document]. To retrieve full + * documents, use + * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] + * or + * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] + * with the + * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] + * returned in the + * [SearchDocumentChunksResponse.results][google.developers.knowledge.v1.SearchDocumentChunksResponse.results]. + * + * The async variant is + * {@see DeveloperKnowledgeClient::searchDocumentChunksAsync()} . + * + * @example samples/V1/DeveloperKnowledgeClient/search_document_chunks.php + * + * @param SearchDocumentChunksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchDocumentChunks(SearchDocumentChunksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchDocumentChunks', $request, $callOptions); + } +} diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..a8d3f9b8bbff --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.developers.knowledge.v1", + "libraryPackage": "Google\\Developers\\Knowledge\\V1", + "services": { + "DeveloperKnowledge": { + "clients": { + "grpc": { + "libraryClient": "DeveloperKnowledgeGapicClient", + "rpcs": { + "BatchGetDocuments": { + "methods": [ + "batchGetDocuments" + ] + }, + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "SearchDocumentChunks": { + "methods": [ + "searchDocumentChunks" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json new file mode 100644 index 000000000000..d2ab1a5d5c0c --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json @@ -0,0 +1,49 @@ +{ + "interfaces": { + "google.developers.knowledge.v1.DeveloperKnowledge": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchGetDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SearchDocumentChunks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php new file mode 100644 index 000000000000..aa75b4338506 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php @@ -0,0 +1,59 @@ + [ + 'google.developers.knowledge.v1.DeveloperKnowledge' => [ + 'BatchGetDocuments' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Developers\Knowledge\V1\BatchGetDocumentsResponse', + ], + 'GetDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Developers\Knowledge\V1\Document', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SearchDocumentChunks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Developers\Knowledge\V1\SearchDocumentChunksResponse', + ], + 'templateMap' => [ + 'document' => 'documents/{document}', + ], + ], + ], +]; diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php new file mode 100644 index 000000000000..c41ea1bc8aef --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php @@ -0,0 +1,48 @@ + [ + 'google.developers.knowledge.v1.DeveloperKnowledge' => [ + 'BatchGetDocuments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/documents:batchGet', + ], + 'GetDocument' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=documents/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SearchDocumentChunks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/documents:searchDocumentChunks', + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/DevelopersKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php b/owl-bot-staging/DevelopersKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php new file mode 100644 index 000000000000..34494a857807 --- /dev/null +++ b/owl-bot-staging/DevelopersKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php @@ -0,0 +1,308 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DeveloperKnowledgeClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DeveloperKnowledgeClient($options); + } + + /** @test */ + public function batchGetDocumentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchGetDocumentsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedNames = [ + $gapicClient->documentName('[DOCUMENT]'), + ]; + $request = (new BatchGetDocumentsRequest()) + ->setNames($formattedNames); + $response = $gapicClient->batchGetDocuments($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.developers.knowledge.v1.DeveloperKnowledge/BatchGetDocuments', $actualFuncCall); + $actualValue = $actualRequestObject->getNames(); + $this->assertProtobufEquals($formattedNames, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchGetDocumentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedNames = [ + $gapicClient->documentName('[DOCUMENT]'), + ]; + $request = (new BatchGetDocumentsRequest()) + ->setNames($formattedNames); + try { + $gapicClient->batchGetDocuments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uri = 'uri116076'; + $content = 'content951530617'; + $description = 'description-1724546052'; + $dataSource = 'dataSource-1333894576'; + $title = 'title110371416'; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $expectedResponse->setUri($uri); + $expectedResponse->setContent($content); + $expectedResponse->setDescription($description); + $expectedResponse->setDataSource($dataSource); + $expectedResponse->setTitle($title); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->documentName('[DOCUMENT]'); + $request = (new GetDocumentRequest()) + ->setName($formattedName); + $response = $gapicClient->getDocument($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.developers.knowledge.v1.DeveloperKnowledge/GetDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->documentName('[DOCUMENT]'); + $request = (new GetDocumentRequest()) + ->setName($formattedName); + try { + $gapicClient->getDocument($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchDocumentChunksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resultsElement = new DocumentChunk(); + $results = [ + $resultsElement, + ]; + $expectedResponse = new SearchDocumentChunksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResults($results); + $transport->addResponse($expectedResponse); + // Mock request + $query = 'query107944136'; + $request = (new SearchDocumentChunksRequest()) + ->setQuery($query); + $response = $gapicClient->searchDocumentChunks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.developers.knowledge.v1.DeveloperKnowledge/SearchDocumentChunks', $actualFuncCall); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchDocumentChunksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $query = 'query107944136'; + $request = (new SearchDocumentChunksRequest()) + ->setQuery($query); + try { + $gapicClient->searchDocumentChunks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchGetDocumentsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchGetDocumentsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedNames = [ + $gapicClient->documentName('[DOCUMENT]'), + ]; + $request = (new BatchGetDocumentsRequest()) + ->setNames($formattedNames); + $response = $gapicClient->batchGetDocumentsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.developers.knowledge.v1.DeveloperKnowledge/BatchGetDocuments', $actualFuncCall); + $actualValue = $actualRequestObject->getNames(); + $this->assertProtobufEquals($formattedNames, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} From 8c01e8ed6f1dd6858857f57f62a1c2eba82a4e92 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 20 May 2026 21:09:36 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../metadata/V1/Developerknowledge.php | 2 +- .../Knowledge/V1/Developerknowledge.php | 29 -- .../Knowledge/V1/BatchGetDocumentsRequest.php | 134 ------- .../V1/BatchGetDocumentsResponse.php | 68 ---- .../Developers/Knowledge/V1/Document.php | 343 ------------------ .../Developers/Knowledge/V1/DocumentChunk.php | 252 ------------- .../Developers/Knowledge/V1/DocumentView.php | 84 ----- .../Knowledge/V1/GetDocumentRequest.php | 142 -------- .../V1/SearchDocumentChunksRequest.php | 322 ---------------- .../V1/SearchDocumentChunksResponse.php | 138 ------- .../batch_get_documents.php | 77 ---- .../DeveloperKnowledgeClient/get_document.php | 73 ---- .../search_document_chunks.php | 87 ----- .../V1/Client/DeveloperKnowledgeClient.php | 336 ----------------- .../v1/src/V1/gapic_metadata.json | 33 -- .../developer_knowledge_client_config.json | 49 --- .../developer_knowledge_descriptor_config.php | 59 --- ...developer_knowledge_rest_client_config.php | 48 --- .../Client/DeveloperKnowledgeClientTest.php | 308 ---------------- 19 files changed, 1 insertion(+), 2583 deletions(-) delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsRequest.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsResponse.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/Document.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentChunk.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentView.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/GetDocumentRequest.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksRequest.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksResponse.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php delete mode 100644 owl-bot-staging/DevelopersKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php diff --git a/DevelopersKnowledge/metadata/V1/Developerknowledge.php b/DevelopersKnowledge/metadata/V1/Developerknowledge.php index ee5e44696234..dff02107be60 100644 --- a/DevelopersKnowledge/metadata/V1/Developerknowledge.php +++ b/DevelopersKnowledge/metadata/V1/Developerknowledge.php @@ -20,7 +20,7 @@ public static function initOnce() { \GPBMetadata\Google\Api\Resource::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\xF9\x11\x0A7google/developers/knowledge/v1/developerknowledge.proto\x12\x1Egoogle.developers.knowledge.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xE0\x02\x0A\x08Document\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x10\x0A\x03uri\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07content\x18\x03 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x04 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdata_source\x18\x05 \x01(\x09B\x03\xE0A\x03\x12\x12\x0A\x05title\x18\x06 \x01(\x09B\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x07 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12?\x0A\x04view\x18\x08 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x03:Z\xEAAW\x0A*developerknowledge.googleapis.com/Document\x12\x14documents/{document}*\x09documents2\x08document\"w\x0A\x1BSearchDocumentChunksRequest\x12\x12\x0A\x05query\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\"|\x0A\x1CSearchDocumentChunksResponse\x12>\x0A\x07results\x18\x01 \x03(\x0B2-.google.developers.knowledge.v1.DocumentChunk\x12\x1C\x0A\x0Fnext_page_token\x18\x02 \x01(\x09B\x03\xE0A\x01\"\x97\x01\x0A\x12GetDocumentRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12?\x0A\x04view\x18\x02 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x01\"\x9E\x01\x0A\x18BatchGetDocumentsRequest\x12A\x0A\x05names\x18\x01 \x03(\x09B2\xE0A\x02\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12?\x0A\x04view\x18\x02 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x01\"X\x0A\x19BatchGetDocumentsResponse\x12;\x0A\x09documents\x18\x01 \x03(\x0B2(.google.developers.knowledge.v1.Document\"\xBB\x01\x0A\x0DDocumentChunk\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x03\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12\x0F\x0A\x02id\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07content\x18\x03 \x01(\x09B\x03\xE0A\x03\x12?\x0A\x08document\x18\x04 \x01(\x0B2(.google.developers.knowledge.v1.DocumentB\x03\xE0A\x03*y\x0A\x0CDocumentView\x12\x1D\x0A\x19DOCUMENT_VIEW_UNSPECIFIED\x10\x00\x12\x17\x0A\x13DOCUMENT_VIEW_BASIC\x10\x01\x12\x16\x0A\x12DOCUMENT_VIEW_FULL\x10\x02\x12\x19\x0A\x15DOCUMENT_VIEW_CONTENT\x10\x032\xEC\x04\x0A\x12DeveloperKnowledge\x12\xBD\x01\x0A\x14SearchDocumentChunks\x12;.google.developers.knowledge.v1.SearchDocumentChunksRequest\x1A<.google.developers.knowledge.v1.SearchDocumentChunksResponse\"*\x82\xD3\xE4\x93\x02\$\x12\"/v1/documents:searchDocumentChunks\x12\x93\x01\x0A\x0BGetDocument\x122.google.developers.knowledge.v1.GetDocumentRequest\x1A(.google.developers.knowledge.v1.Document\"&\xDAA\x04name\x82\xD3\xE4\x93\x02\x19\x12\x17/v1/{name=documents/**}\x12\xA8\x01\x0A\x11BatchGetDocuments\x128.google.developers.knowledge.v1.BatchGetDocumentsRequest\x1A9.google.developers.knowledge.v1.BatchGetDocumentsResponse\"\x1E\x82\xD3\xE4\x93\x02\x18\x12\x16/v1/documents:batchGet\x1AU\xCAA!developerknowledge.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\x88\x01\x0A\"com.google.developers.knowledge.v1B\x17DeveloperKnowledgeProtoP\x01ZGgoogle.golang.org/genproto/googleapis/developers/knowledge/v1;knowledgeb\x06proto3" + "\x0A\xA6\x12\x0A7google/developers/knowledge/v1/developerknowledge.proto\x12\x1Egoogle.developers.knowledge.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xE0\x02\x0A\x08Document\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x10\x0A\x03uri\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07content\x18\x03 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x04 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdata_source\x18\x05 \x01(\x09B\x03\xE0A\x03\x12\x12\x0A\x05title\x18\x06 \x01(\x09B\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x07 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12?\x0A\x04view\x18\x08 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x03:Z\xEAAW\x0A*developerknowledge.googleapis.com/Document\x12\x14documents/{document}*\x09documents2\x08document\"w\x0A\x1BSearchDocumentChunksRequest\x12\x12\x0A\x05query\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\"|\x0A\x1CSearchDocumentChunksResponse\x12>\x0A\x07results\x18\x01 \x03(\x0B2-.google.developers.knowledge.v1.DocumentChunk\x12\x1C\x0A\x0Fnext_page_token\x18\x02 \x01(\x09B\x03\xE0A\x01\"\x97\x01\x0A\x12GetDocumentRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12?\x0A\x04view\x18\x02 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x01\"\x9E\x01\x0A\x18BatchGetDocumentsRequest\x12A\x0A\x05names\x18\x01 \x03(\x09B2\xE0A\x02\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12?\x0A\x04view\x18\x02 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x01\"X\x0A\x19BatchGetDocumentsResponse\x12;\x0A\x09documents\x18\x01 \x03(\x0B2(.google.developers.knowledge.v1.Document\"\xBB\x01\x0A\x0DDocumentChunk\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x03\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12\x0F\x0A\x02id\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07content\x18\x03 \x01(\x09B\x03\xE0A\x03\x12?\x0A\x08document\x18\x04 \x01(\x0B2(.google.developers.knowledge.v1.DocumentB\x03\xE0A\x03*y\x0A\x0CDocumentView\x12\x1D\x0A\x19DOCUMENT_VIEW_UNSPECIFIED\x10\x00\x12\x17\x0A\x13DOCUMENT_VIEW_BASIC\x10\x01\x12\x16\x0A\x12DOCUMENT_VIEW_FULL\x10\x02\x12\x19\x0A\x15DOCUMENT_VIEW_CONTENT\x10\x032\xEC\x04\x0A\x12DeveloperKnowledge\x12\xBD\x01\x0A\x14SearchDocumentChunks\x12;.google.developers.knowledge.v1.SearchDocumentChunksRequest\x1A<.google.developers.knowledge.v1.SearchDocumentChunksResponse\"*\x82\xD3\xE4\x93\x02\$\x12\"/v1/documents:searchDocumentChunks\x12\x93\x01\x0A\x0BGetDocument\x122.google.developers.knowledge.v1.GetDocumentRequest\x1A(.google.developers.knowledge.v1.Document\"&\xDAA\x04name\x82\xD3\xE4\x93\x02\x19\x12\x17/v1/{name=documents/**}\x12\xA8\x01\x0A\x11BatchGetDocuments\x128.google.developers.knowledge.v1.BatchGetDocumentsRequest\x1A9.google.developers.knowledge.v1.BatchGetDocumentsResponse\"\x1E\x82\xD3\xE4\x93\x02\x18\x12\x16/v1/documents:batchGet\x1AU\xCAA!developerknowledge.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xB5\x01\x0A\"com.google.developers.knowledge.v1B\x17DeveloperKnowledgeProtoP\x01ZGgoogle.golang.org/genproto/googleapis/developers/knowledge/v1;knowledge\xEA\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3" , true); static::$is_initialized = true; diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php deleted file mode 100644 index dff02107be60..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php +++ /dev/null @@ -1,29 +0,0 @@ -internalAddGeneratedFile( - "\x0A\xA6\x12\x0A7google/developers/knowledge/v1/developerknowledge.proto\x12\x1Egoogle.developers.knowledge.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xE0\x02\x0A\x08Document\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x10\x0A\x03uri\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07content\x18\x03 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x04 \x01(\x09B\x03\xE0A\x03\x12\x18\x0A\x0Bdata_source\x18\x05 \x01(\x09B\x03\xE0A\x03\x12\x12\x0A\x05title\x18\x06 \x01(\x09B\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x07 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12?\x0A\x04view\x18\x08 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x03:Z\xEAAW\x0A*developerknowledge.googleapis.com/Document\x12\x14documents/{document}*\x09documents2\x08document\"w\x0A\x1BSearchDocumentChunksRequest\x12\x12\x0A\x05query\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\"|\x0A\x1CSearchDocumentChunksResponse\x12>\x0A\x07results\x18\x01 \x03(\x0B2-.google.developers.knowledge.v1.DocumentChunk\x12\x1C\x0A\x0Fnext_page_token\x18\x02 \x01(\x09B\x03\xE0A\x01\"\x97\x01\x0A\x12GetDocumentRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12?\x0A\x04view\x18\x02 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x01\"\x9E\x01\x0A\x18BatchGetDocumentsRequest\x12A\x0A\x05names\x18\x01 \x03(\x09B2\xE0A\x02\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12?\x0A\x04view\x18\x02 \x01(\x0E2,.google.developers.knowledge.v1.DocumentViewB\x03\xE0A\x01\"X\x0A\x19BatchGetDocumentsResponse\x12;\x0A\x09documents\x18\x01 \x03(\x0B2(.google.developers.knowledge.v1.Document\"\xBB\x01\x0A\x0DDocumentChunk\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x03\xFAA,\x0A*developerknowledge.googleapis.com/Document\x12\x0F\x0A\x02id\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x14\x0A\x07content\x18\x03 \x01(\x09B\x03\xE0A\x03\x12?\x0A\x08document\x18\x04 \x01(\x0B2(.google.developers.knowledge.v1.DocumentB\x03\xE0A\x03*y\x0A\x0CDocumentView\x12\x1D\x0A\x19DOCUMENT_VIEW_UNSPECIFIED\x10\x00\x12\x17\x0A\x13DOCUMENT_VIEW_BASIC\x10\x01\x12\x16\x0A\x12DOCUMENT_VIEW_FULL\x10\x02\x12\x19\x0A\x15DOCUMENT_VIEW_CONTENT\x10\x032\xEC\x04\x0A\x12DeveloperKnowledge\x12\xBD\x01\x0A\x14SearchDocumentChunks\x12;.google.developers.knowledge.v1.SearchDocumentChunksRequest\x1A<.google.developers.knowledge.v1.SearchDocumentChunksResponse\"*\x82\xD3\xE4\x93\x02\$\x12\"/v1/documents:searchDocumentChunks\x12\x93\x01\x0A\x0BGetDocument\x122.google.developers.knowledge.v1.GetDocumentRequest\x1A(.google.developers.knowledge.v1.Document\"&\xDAA\x04name\x82\xD3\xE4\x93\x02\x19\x12\x17/v1/{name=documents/**}\x12\xA8\x01\x0A\x11BatchGetDocuments\x128.google.developers.knowledge.v1.BatchGetDocumentsRequest\x1A9.google.developers.knowledge.v1.BatchGetDocumentsResponse\"\x1E\x82\xD3\xE4\x93\x02\x18\x12\x16/v1/documents:batchGet\x1AU\xCAA!developerknowledge.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xB5\x01\x0A\"com.google.developers.knowledge.v1B\x17DeveloperKnowledgeProtoP\x01ZGgoogle.golang.org/genproto/googleapis/developers/knowledge/v1;knowledge\xEA\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3" - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsRequest.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsRequest.php deleted file mode 100644 index 535c5d13f7a7..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsRequest.php +++ /dev/null @@ -1,134 +0,0 @@ -google.developers.knowledge.v1.BatchGetDocumentsRequest - */ -class BatchGetDocumentsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Specifies the names of the documents to retrieve. A maximum of 20 - * documents can be retrieved in a batch. The documents are returned in the - * same order as the `names` in the request. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $names; - /** - * Optional. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. If unspecified, - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * defaults to `DOCUMENT_VIEW_CONTENT`. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string[] $names - * Required. Specifies the names of the documents to retrieve. A maximum of 20 - * documents can be retrieved in a batch. The documents are returned in the - * same order as the `names` in the request. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * @type int $view - * Optional. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. If unspecified, - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * defaults to `DOCUMENT_VIEW_CONTENT`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Required. Specifies the names of the documents to retrieve. A maximum of 20 - * documents can be retrieved in a batch. The documents are returned in the - * same order as the `names` in the request. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return RepeatedField - */ - public function getNames() - { - return $this->names; - } - - /** - * Required. Specifies the names of the documents to retrieve. A maximum of 20 - * documents can be retrieved in a batch. The documents are returned in the - * same order as the `names` in the request. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string[] $var - * @return $this - */ - public function setNames($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->names = $arr; - - return $this; - } - - /** - * Optional. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. If unspecified, - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * defaults to `DOCUMENT_VIEW_CONTENT`. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. If unspecified, - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * defaults to `DOCUMENT_VIEW_CONTENT`. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Developers\Knowledge\V1\DocumentView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsResponse.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsResponse.php deleted file mode 100644 index 9352f4a5dab9..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/BatchGetDocumentsResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.developers.knowledge.v1.BatchGetDocumentsResponse - */ -class BatchGetDocumentsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Contains the documents requested. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Document documents = 1; - */ - private $documents; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Developers\Knowledge\V1\Document[] $documents - * Contains the documents requested. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Contains the documents requested. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Document documents = 1; - * @return RepeatedField<\Google\Developers\Knowledge\V1\Document> - */ - public function getDocuments() - { - return $this->documents; - } - - /** - * Contains the documents requested. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Document documents = 1; - * @param \Google\Developers\Knowledge\V1\Document[] $var - * @return $this - */ - public function setDocuments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\Knowledge\V1\Document::class); - $this->documents = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/Document.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/Document.php deleted file mode 100644 index e1e933a323ee..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/Document.php +++ /dev/null @@ -1,343 +0,0 @@ -google.developers.knowledge.v1.Document - */ -class Document extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. Contains the resource name of the document. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * Output only. Provides the URI of the content, such as - * `docs.cloud.google.com/storage/docs/creating-buckets`. - * - * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uri = ''; - /** - * Output only. Contains the full content of the document in Markdown format. - * - * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $content = ''; - /** - * Output only. Provides a description of the document. - * - * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $description = ''; - /** - * Output only. Specifies the data source of the document. - * Example data source: `firebase.google.com` - * - * Generated from protobuf field string data_source = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $data_source = ''; - /** - * Output only. Provides the title of the document. - * - * Generated from protobuf field string title = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $title = ''; - /** - * Output only. Represents the timestamp when the content or metadata of the - * document was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Identifier. Contains the resource name of the document. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * @type string $uri - * Output only. Provides the URI of the content, such as - * `docs.cloud.google.com/storage/docs/creating-buckets`. - * @type string $content - * Output only. Contains the full content of the document in Markdown format. - * @type string $description - * Output only. Provides a description of the document. - * @type string $data_source - * Output only. Specifies the data source of the document. - * Example data source: `firebase.google.com` - * @type string $title - * Output only. Provides the title of the document. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Represents the timestamp when the content or metadata of the - * document was last updated. - * @type int $view - * Output only. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Identifier. Contains the resource name of the document. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. Contains the resource name of the document. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Provides the URI of the content, such as - * `docs.cloud.google.com/storage/docs/creating-buckets`. - * - * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Output only. Provides the URI of the content, such as - * `docs.cloud.google.com/storage/docs/creating-buckets`. - * - * Generated from protobuf field string uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Output only. Contains the full content of the document in Markdown format. - * - * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Output only. Contains the full content of the document in Markdown format. - * - * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, True); - $this->content = $var; - - return $this; - } - - /** - * Output only. Provides a description of the document. - * - * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Output only. Provides a description of the document. - * - * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. Specifies the data source of the document. - * Example data source: `firebase.google.com` - * - * Generated from protobuf field string data_source = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDataSource() - { - return $this->data_source; - } - - /** - * Output only. Specifies the data source of the document. - * Example data source: `firebase.google.com` - * - * Generated from protobuf field string data_source = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDataSource($var) - { - GPBUtil::checkString($var, True); - $this->data_source = $var; - - return $this; - } - - /** - * Output only. Provides the title of the document. - * - * Generated from protobuf field string title = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Output only. Provides the title of the document. - * - * Generated from protobuf field string title = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTitle($var) - { - GPBUtil::checkString($var, True); - $this->title = $var; - - return $this; - } - - /** - * Output only. Represents the timestamp when the content or metadata of the - * document was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. Represents the timestamp when the content or metadata of the - * document was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Output only. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Developers\Knowledge\V1\DocumentView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentChunk.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentChunk.php deleted file mode 100644 index e8895fa575a3..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentChunk.php +++ /dev/null @@ -1,252 +0,0 @@ -google.developers.knowledge.v1.DocumentChunk - */ -class DocumentChunk extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Contains the resource name of the document this chunk is from. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Output only. Specifies the ID of this chunk within the document. The chunk - * ID is unique within a document, but not globally unique across documents. - * The chunk ID is not stable and may change over time. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $id = ''; - /** - * Output only. Contains the content of the document chunk. - * - * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $content = ''; - /** - * Output only. Represents metadata about the - * [Document][google.developers.knowledge.v1.Document] this chunk is from. The - * [DocumentView][google.developers.knowledge.v1.DocumentView] of this - * [Document][google.developers.knowledge.v1.Document] message will be set to - * `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients - * do not need to call - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * if they only need the metadata fields. Otherwise, clients should use - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * to fetch the full document content. - * - * Generated from protobuf field .google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $document = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Output only. Contains the resource name of the document this chunk is from. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * @type string $id - * Output only. Specifies the ID of this chunk within the document. The chunk - * ID is unique within a document, but not globally unique across documents. - * The chunk ID is not stable and may change over time. - * @type string $content - * Output only. Contains the content of the document chunk. - * @type \Google\Developers\Knowledge\V1\Document $document - * Output only. Represents metadata about the - * [Document][google.developers.knowledge.v1.Document] this chunk is from. The - * [DocumentView][google.developers.knowledge.v1.DocumentView] of this - * [Document][google.developers.knowledge.v1.Document] message will be set to - * `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients - * do not need to call - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * if they only need the metadata fields. Otherwise, clients should use - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * to fetch the full document content. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Contains the resource name of the document this chunk is from. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Output only. Contains the resource name of the document this chunk is from. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Output only. Specifies the ID of this chunk within the document. The chunk - * ID is unique within a document, but not globally unique across documents. - * The chunk ID is not stable and may change over time. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Output only. Specifies the ID of this chunk within the document. The chunk - * ID is unique within a document, but not globally unique across documents. - * The chunk ID is not stable and may change over time. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Output only. Contains the content of the document chunk. - * - * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Output only. Contains the content of the document chunk. - * - * Generated from protobuf field string content = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, True); - $this->content = $var; - - return $this; - } - - /** - * Output only. Represents metadata about the - * [Document][google.developers.knowledge.v1.Document] this chunk is from. The - * [DocumentView][google.developers.knowledge.v1.DocumentView] of this - * [Document][google.developers.knowledge.v1.Document] message will be set to - * `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients - * do not need to call - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * if they only need the metadata fields. Otherwise, clients should use - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * to fetch the full document content. - * - * Generated from protobuf field .google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Developers\Knowledge\V1\Document|null - */ - public function getDocument() - { - return $this->document; - } - - public function hasDocument() - { - return isset($this->document); - } - - public function clearDocument() - { - unset($this->document); - } - - /** - * Output only. Represents metadata about the - * [Document][google.developers.knowledge.v1.Document] this chunk is from. The - * [DocumentView][google.developers.knowledge.v1.DocumentView] of this - * [Document][google.developers.knowledge.v1.Document] message will be set to - * `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients - * do not need to call - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * if they only need the metadata fields. Otherwise, clients should use - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * to fetch the full document content. - * - * Generated from protobuf field .google.developers.knowledge.v1.Document document = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Developers\Knowledge\V1\Document $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkMessage($var, \Google\Developers\Knowledge\V1\Document::class); - $this->document = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentView.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentView.php deleted file mode 100644 index 72939ed3075e..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/DocumentView.php +++ /dev/null @@ -1,84 +0,0 @@ -google.developers.knowledge.v1.DocumentView - */ -class DocumentView -{ - /** - * The default / unset value. See each API method for its default value if - * [DocumentView][google.developers.knowledge.v1.DocumentView] is not - * specified. - * - * Generated from protobuf enum DOCUMENT_VIEW_UNSPECIFIED = 0; - */ - const DOCUMENT_VIEW_UNSPECIFIED = 0; - /** - * Includes only the basic metadata fields: - * - `name` - * - `uri` - * - `data_source` - * - `title` - * - `description` - * - `update_time` - * - `view` - * This is the default of view for - * [DeveloperKnowledge.SearchDocumentChunks][google.developers.knowledge.v1.DeveloperKnowledge.SearchDocumentChunks]. - * - * Generated from protobuf enum DOCUMENT_VIEW_BASIC = 1; - */ - const DOCUMENT_VIEW_BASIC = 1; - /** - * Includes all [Document][google.developers.knowledge.v1.Document] fields. - * - * Generated from protobuf enum DOCUMENT_VIEW_FULL = 2; - */ - const DOCUMENT_VIEW_FULL = 2; - /** - * Includes the `DOCUMENT_VIEW_BASIC` fields and the `content` field. - * This is the default of view for - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * and - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]. - * - * Generated from protobuf enum DOCUMENT_VIEW_CONTENT = 3; - */ - const DOCUMENT_VIEW_CONTENT = 3; - - private static $valueToName = [ - self::DOCUMENT_VIEW_UNSPECIFIED => 'DOCUMENT_VIEW_UNSPECIFIED', - self::DOCUMENT_VIEW_BASIC => 'DOCUMENT_VIEW_BASIC', - self::DOCUMENT_VIEW_FULL => 'DOCUMENT_VIEW_FULL', - self::DOCUMENT_VIEW_CONTENT => 'DOCUMENT_VIEW_CONTENT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/GetDocumentRequest.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/GetDocumentRequest.php deleted file mode 100644 index 2b4ce5f16d9e..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/GetDocumentRequest.php +++ /dev/null @@ -1,142 +0,0 @@ -google.developers.knowledge.v1.GetDocumentRequest - */ -class GetDocumentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Specifies the name of the document to retrieve. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. If unspecified, - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * defaults to `DOCUMENT_VIEW_CONTENT`. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - - /** - * @param string $name Required. Specifies the name of the document to retrieve. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * Please see {@see DeveloperKnowledgeClient::documentName()} for help formatting this field. - * - * @return \Google\Developers\Knowledge\V1\GetDocumentRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Specifies the name of the document to retrieve. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * @type int $view - * Optional. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. If unspecified, - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * defaults to `DOCUMENT_VIEW_CONTENT`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Required. Specifies the name of the document to retrieve. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Specifies the name of the document to retrieve. - * Format: `documents/{uri_without_scheme}` - * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. If unspecified, - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * defaults to `DOCUMENT_VIEW_CONTENT`. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. Specifies the - * [DocumentView][google.developers.knowledge.v1.DocumentView] of the - * document. If unspecified, - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * defaults to `DOCUMENT_VIEW_CONTENT`. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Developers\Knowledge\V1\DocumentView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksRequest.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksRequest.php deleted file mode 100644 index a4e8912ce468..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksRequest.php +++ /dev/null @@ -1,322 +0,0 @@ -google.developers.knowledge.v1.SearchDocumentChunksRequest - */ -class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Provides the raw query string provided by the user, such as "How - * to create a Cloud Storage bucket?". - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $query = ''; - /** - * Optional. Specifies the maximum number of results to return. The service - * may return fewer than this value. - * If unspecified, at most 5 results will be returned. - * The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT - * error. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. Contains a page token, received from a previous - * `SearchDocumentChunks` call. Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Applies a strict filter to the search results. The expression - * supports a subset of the syntax described at https://google.aip.dev/160. - * While `SearchDocumentChunks` returns - * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter - * is applied to `DocumentChunk.document` fields. - * Supported fields for filtering: - * * `data_source` (STRING): The source of the document, e.g. - * `docs.cloud.google.com`. See - * https://developers.google.com/knowledge/reference/corpus-reference for - * the complete list of data sources in the corpus. - * * `update_time` (TIMESTAMP): The timestamp of when the document was last - * meaningfully updated. A meaningful update is one that changes document's - * markdown content or metadata. - * * `uri` (STRING): The document URI, e.g. - * `https://docs.cloud.google.com/bigquery/docs/tables`. - * STRING fields support `=` (equals) and `!=` (not equals) operators for - * **exact match** on the whole string. Partial match, prefix match, and - * regexp match are not supported. - * TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. - * Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. - * You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical - * operators. `OR` has higher precedence than `AND`. Use parentheses for - * explicit precedence grouping. - * Examples: - * * `data_source = "docs.cloud.google.com" OR data_source = - * "firebase.google.com"` - * * `data_source != "firebase.google.com"` - * * `update_time < "2024-01-01T00:00:00Z"` - * * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = - * "developer.chrome.com" OR data_source = "web.dev")` - * * `uri = "https://docs.cloud.google.com/release-notes"` - * The `filter` string must not exceed 500 characters; values longer than 500 - * characters will result in an `INVALID_ARGUMENT` error. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query - * Required. Provides the raw query string provided by the user, such as "How - * to create a Cloud Storage bucket?". - * @type int $page_size - * Optional. Specifies the maximum number of results to return. The service - * may return fewer than this value. - * If unspecified, at most 5 results will be returned. - * The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT - * error. - * @type string $page_token - * Optional. Contains a page token, received from a previous - * `SearchDocumentChunks` call. Provide this to retrieve the subsequent page. - * @type string $filter - * Optional. Applies a strict filter to the search results. The expression - * supports a subset of the syntax described at https://google.aip.dev/160. - * While `SearchDocumentChunks` returns - * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter - * is applied to `DocumentChunk.document` fields. - * Supported fields for filtering: - * * `data_source` (STRING): The source of the document, e.g. - * `docs.cloud.google.com`. See - * https://developers.google.com/knowledge/reference/corpus-reference for - * the complete list of data sources in the corpus. - * * `update_time` (TIMESTAMP): The timestamp of when the document was last - * meaningfully updated. A meaningful update is one that changes document's - * markdown content or metadata. - * * `uri` (STRING): The document URI, e.g. - * `https://docs.cloud.google.com/bigquery/docs/tables`. - * STRING fields support `=` (equals) and `!=` (not equals) operators for - * **exact match** on the whole string. Partial match, prefix match, and - * regexp match are not supported. - * TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. - * Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. - * You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical - * operators. `OR` has higher precedence than `AND`. Use parentheses for - * explicit precedence grouping. - * Examples: - * * `data_source = "docs.cloud.google.com" OR data_source = - * "firebase.google.com"` - * * `data_source != "firebase.google.com"` - * * `update_time < "2024-01-01T00:00:00Z"` - * * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = - * "developer.chrome.com" OR data_source = "web.dev")` - * * `uri = "https://docs.cloud.google.com/release-notes"` - * The `filter` string must not exceed 500 characters; values longer than 500 - * characters will result in an `INVALID_ARGUMENT` error. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Required. Provides the raw query string provided by the user, such as "How - * to create a Cloud Storage bucket?". - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. Provides the raw query string provided by the user, such as "How - * to create a Cloud Storage bucket?". - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkString($var, True); - $this->query = $var; - - return $this; - } - - /** - * Optional. Specifies the maximum number of results to return. The service - * may return fewer than this value. - * If unspecified, at most 5 results will be returned. - * The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT - * error. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Specifies the maximum number of results to return. The service - * may return fewer than this value. - * If unspecified, at most 5 results will be returned. - * The maximum value is 20; values above 20 will result in an INVALID_ARGUMENT - * error. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. Contains a page token, received from a previous - * `SearchDocumentChunks` call. Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. Contains a page token, received from a previous - * `SearchDocumentChunks` call. Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Applies a strict filter to the search results. The expression - * supports a subset of the syntax described at https://google.aip.dev/160. - * While `SearchDocumentChunks` returns - * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter - * is applied to `DocumentChunk.document` fields. - * Supported fields for filtering: - * * `data_source` (STRING): The source of the document, e.g. - * `docs.cloud.google.com`. See - * https://developers.google.com/knowledge/reference/corpus-reference for - * the complete list of data sources in the corpus. - * * `update_time` (TIMESTAMP): The timestamp of when the document was last - * meaningfully updated. A meaningful update is one that changes document's - * markdown content or metadata. - * * `uri` (STRING): The document URI, e.g. - * `https://docs.cloud.google.com/bigquery/docs/tables`. - * STRING fields support `=` (equals) and `!=` (not equals) operators for - * **exact match** on the whole string. Partial match, prefix match, and - * regexp match are not supported. - * TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. - * Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. - * You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical - * operators. `OR` has higher precedence than `AND`. Use parentheses for - * explicit precedence grouping. - * Examples: - * * `data_source = "docs.cloud.google.com" OR data_source = - * "firebase.google.com"` - * * `data_source != "firebase.google.com"` - * * `update_time < "2024-01-01T00:00:00Z"` - * * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = - * "developer.chrome.com" OR data_source = "web.dev")` - * * `uri = "https://docs.cloud.google.com/release-notes"` - * The `filter` string must not exceed 500 characters; values longer than 500 - * characters will result in an `INVALID_ARGUMENT` error. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Applies a strict filter to the search results. The expression - * supports a subset of the syntax described at https://google.aip.dev/160. - * While `SearchDocumentChunks` returns - * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter - * is applied to `DocumentChunk.document` fields. - * Supported fields for filtering: - * * `data_source` (STRING): The source of the document, e.g. - * `docs.cloud.google.com`. See - * https://developers.google.com/knowledge/reference/corpus-reference for - * the complete list of data sources in the corpus. - * * `update_time` (TIMESTAMP): The timestamp of when the document was last - * meaningfully updated. A meaningful update is one that changes document's - * markdown content or metadata. - * * `uri` (STRING): The document URI, e.g. - * `https://docs.cloud.google.com/bigquery/docs/tables`. - * STRING fields support `=` (equals) and `!=` (not equals) operators for - * **exact match** on the whole string. Partial match, prefix match, and - * regexp match are not supported. - * TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. - * Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. - * You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical - * operators. `OR` has higher precedence than `AND`. Use parentheses for - * explicit precedence grouping. - * Examples: - * * `data_source = "docs.cloud.google.com" OR data_source = - * "firebase.google.com"` - * * `data_source != "firebase.google.com"` - * * `update_time < "2024-01-01T00:00:00Z"` - * * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = - * "developer.chrome.com" OR data_source = "web.dev")` - * * `uri = "https://docs.cloud.google.com/release-notes"` - * The `filter` string must not exceed 500 characters; values longer than 500 - * characters will result in an `INVALID_ARGUMENT` error. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksResponse.php b/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksResponse.php deleted file mode 100644 index 0e0a7dca389b..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/proto/src/Google/Developers/Knowledge/V1/SearchDocumentChunksResponse.php +++ /dev/null @@ -1,138 +0,0 @@ -google.developers.knowledge.v1.SearchDocumentChunksResponse - */ -class SearchDocumentChunksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Contains the search results for the given query. Each - * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list - * contains a snippet of content relevant to the search query. Use the - * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] - * field of each result with - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * to retrieve the full document content. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.DocumentChunk results = 1; - */ - private $results; - /** - * Optional. Provides a token that can be sent as `page_token` to retrieve the - * next page. If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Developers\Knowledge\V1\DocumentChunk[] $results - * Contains the search results for the given query. Each - * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list - * contains a snippet of content relevant to the search query. Use the - * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] - * field of each result with - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * to retrieve the full document content. - * @type string $next_page_token - * Optional. Provides a token that can be sent as `page_token` to retrieve the - * next page. If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Contains the search results for the given query. Each - * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list - * contains a snippet of content relevant to the search query. Use the - * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] - * field of each result with - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * to retrieve the full document content. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.DocumentChunk results = 1; - * @return RepeatedField<\Google\Developers\Knowledge\V1\DocumentChunk> - */ - public function getResults() - { - return $this->results; - } - - /** - * Contains the search results for the given query. Each - * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list - * contains a snippet of content relevant to the search query. Use the - * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] - * field of each result with - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * to retrieve the full document content. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.DocumentChunk results = 1; - * @param \Google\Developers\Knowledge\V1\DocumentChunk[] $var - * @return $this - */ - public function setResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\Knowledge\V1\DocumentChunk::class); - $this->results = $arr; - - return $this; - } - - /** - * Optional. Provides a token that can be sent as `page_token` to retrieve the - * next page. If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Optional. Provides a token that can be sent as `page_token` to retrieve the - * next page. If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php deleted file mode 100644 index c1f4812761d5..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php +++ /dev/null @@ -1,77 +0,0 @@ -setNames($formattedNames); - - // Call the API and handle any network failures. - try { - /** @var BatchGetDocumentsResponse $response */ - $response = $developerKnowledgeClient->batchGetDocuments($request); - 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 -{ - $formattedNamesElement = DeveloperKnowledgeClient::documentName('[DOCUMENT]'); - - batch_get_documents_sample($formattedNamesElement); -} -// [END developerknowledge_v1_generated_DeveloperKnowledge_BatchGetDocuments_sync] diff --git a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php deleted file mode 100644 index 9564343c9bc5..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $developerKnowledgeClient->getDocument($request); - 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 = DeveloperKnowledgeClient::documentName('[DOCUMENT]'); - - get_document_sample($formattedName); -} -// [END developerknowledge_v1_generated_DeveloperKnowledge_GetDocument_sync] diff --git a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php b/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php deleted file mode 100644 index 6eea019ba96a..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php +++ /dev/null @@ -1,87 +0,0 @@ -setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $developerKnowledgeClient->searchDocumentChunks($request); - - /** @var DocumentChunk $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 -{ - $query = '[QUERY]'; - - search_document_chunks_sample($query); -} -// [END developerknowledge_v1_generated_DeveloperKnowledge_SearchDocumentChunks_sync] diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php deleted file mode 100644 index 27909f31fad0..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php +++ /dev/null @@ -1,336 +0,0 @@ - batchGetDocumentsAsync(BatchGetDocumentsRequest $request, array $optionalArgs = []) - * @method PromiseInterface getDocumentAsync(GetDocumentRequest $request, array $optionalArgs = []) - * @method PromiseInterface searchDocumentChunksAsync(SearchDocumentChunksRequest $request, array $optionalArgs = []) - */ -final class DeveloperKnowledgeClient -{ - use GapicClientTrait; - use ResourceHelperTrait; - - /** The name of the service. */ - private const SERVICE_NAME = 'google.developers.knowledge.v1.DeveloperKnowledge'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - private const SERVICE_ADDRESS = 'developerknowledge.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'developerknowledge.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - private const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - private const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/developer_knowledge_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/developer_knowledge_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/developer_knowledge_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/developer_knowledge_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a document - * resource. - * - * @param string $document - * - * @return string The formatted document resource. - */ - public static function documentName(string $document): string - { - return self::getPathTemplate('document')->render([ - 'document' => $document, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - document: documents/{document} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param ?string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, ?string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array|ClientOptions $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'developerknowledge.googleapis.com:443'. - * @type FetchAuthTokenInterface|CredentialsWrapper $credentials - * This option should only be used with a pre-constructed - * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that - * when one of these objects are provided, any settings in $credentialsConfig will - * be ignored. - * **Important**: If you are providing a path to a credentials file, or a decoded - * credentials file as a PHP array, this usage is now DEPRECATED. Providing an - * unvalidated credential configuration to Google APIs can compromise the security - * of your systems and data. It is recommended to create the credentials explicitly - * ``` - * use Google\Auth\Credentials\ServiceAccountCredentials; - * use Google\Developers\Knowledge\V1\DeveloperKnowledgeClient; - * $creds = new ServiceAccountCredentials($scopes, $json); - * $options = new DeveloperKnowledgeClient(['credentials' => $creds]); - * ``` - * {@see - * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * @type false|LoggerInterface $logger - * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the - * 'GOOGLE_SDK_PHP_LOGGING' environment flag - * @type string $universeDomain - * The service domain for the client. Defaults to 'googleapis.com'. - * } - * - * @throws ValidationException - */ - public function __construct(array|ClientOptions $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Retrieves multiple documents, each with its full Markdown content. - * - * The async variant is {@see DeveloperKnowledgeClient::batchGetDocumentsAsync()} . - * - * @example samples/V1/DeveloperKnowledgeClient/batch_get_documents.php - * - * @param BatchGetDocumentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return BatchGetDocumentsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchGetDocuments(BatchGetDocumentsRequest $request, array $callOptions = []): BatchGetDocumentsResponse - { - return $this->startApiCall('BatchGetDocuments', $request, $callOptions)->wait(); - } - - /** - * Retrieves a single document with its full Markdown content. - * - * The async variant is {@see DeveloperKnowledgeClient::getDocumentAsync()} . - * - * @example samples/V1/DeveloperKnowledgeClient/get_document.php - * - * @param GetDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Document - * - * @throws ApiException Thrown if the API call fails. - */ - public function getDocument(GetDocumentRequest $request, array $callOptions = []): Document - { - return $this->startApiCall('GetDocument', $request, $callOptions)->wait(); - } - - /** - * Searches for developer knowledge across Google's developer documentation. - * Returns [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s - * based on the user's query. There may be many chunks from the same - * [Document][google.developers.knowledge.v1.Document]. To retrieve full - * documents, use - * [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] - * or - * [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments] - * with the - * [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent] - * returned in the - * [SearchDocumentChunksResponse.results][google.developers.knowledge.v1.SearchDocumentChunksResponse.results]. - * - * The async variant is - * {@see DeveloperKnowledgeClient::searchDocumentChunksAsync()} . - * - * @example samples/V1/DeveloperKnowledgeClient/search_document_chunks.php - * - * @param SearchDocumentChunksRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchDocumentChunks(SearchDocumentChunksRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchDocumentChunks', $request, $callOptions); - } -} diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/gapic_metadata.json deleted file mode 100644 index a8d3f9b8bbff..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.developers.knowledge.v1", - "libraryPackage": "Google\\Developers\\Knowledge\\V1", - "services": { - "DeveloperKnowledge": { - "clients": { - "grpc": { - "libraryClient": "DeveloperKnowledgeGapicClient", - "rpcs": { - "BatchGetDocuments": { - "methods": [ - "batchGetDocuments" - ] - }, - "GetDocument": { - "methods": [ - "getDocument" - ] - }, - "SearchDocumentChunks": { - "methods": [ - "searchDocumentChunks" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json deleted file mode 100644 index d2ab1a5d5c0c..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "interfaces": { - "google.developers.knowledge.v1.DeveloperKnowledge": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "BatchGetDocuments": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetDocument": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "SearchDocumentChunks": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php deleted file mode 100644 index aa75b4338506..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php +++ /dev/null @@ -1,59 +0,0 @@ - [ - 'google.developers.knowledge.v1.DeveloperKnowledge' => [ - 'BatchGetDocuments' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Developers\Knowledge\V1\BatchGetDocumentsResponse', - ], - 'GetDocument' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Developers\Knowledge\V1\Document', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'SearchDocumentChunks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResults', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Developers\Knowledge\V1\SearchDocumentChunksResponse', - ], - 'templateMap' => [ - 'document' => 'documents/{document}', - ], - ], - ], -]; diff --git a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php b/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php deleted file mode 100644 index c41ea1bc8aef..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php +++ /dev/null @@ -1,48 +0,0 @@ - [ - 'google.developers.knowledge.v1.DeveloperKnowledge' => [ - 'BatchGetDocuments' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/documents:batchGet', - ], - 'GetDocument' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=documents/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'SearchDocumentChunks' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/documents:searchDocumentChunks', - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/DevelopersKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php b/owl-bot-staging/DevelopersKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php deleted file mode 100644 index 34494a857807..000000000000 --- a/owl-bot-staging/DevelopersKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php +++ /dev/null @@ -1,308 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DeveloperKnowledgeClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DeveloperKnowledgeClient($options); - } - - /** @test */ - public function batchGetDocumentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchGetDocumentsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedNames = [ - $gapicClient->documentName('[DOCUMENT]'), - ]; - $request = (new BatchGetDocumentsRequest()) - ->setNames($formattedNames); - $response = $gapicClient->batchGetDocuments($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.developers.knowledge.v1.DeveloperKnowledge/BatchGetDocuments', $actualFuncCall); - $actualValue = $actualRequestObject->getNames(); - $this->assertProtobufEquals($formattedNames, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchGetDocumentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedNames = [ - $gapicClient->documentName('[DOCUMENT]'), - ]; - $request = (new BatchGetDocumentsRequest()) - ->setNames($formattedNames); - try { - $gapicClient->batchGetDocuments($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uri = 'uri116076'; - $content = 'content951530617'; - $description = 'description-1724546052'; - $dataSource = 'dataSource-1333894576'; - $title = 'title110371416'; - $expectedResponse = new Document(); - $expectedResponse->setName($name2); - $expectedResponse->setUri($uri); - $expectedResponse->setContent($content); - $expectedResponse->setDescription($description); - $expectedResponse->setDataSource($dataSource); - $expectedResponse->setTitle($title); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->documentName('[DOCUMENT]'); - $request = (new GetDocumentRequest()) - ->setName($formattedName); - $response = $gapicClient->getDocument($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.developers.knowledge.v1.DeveloperKnowledge/GetDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->documentName('[DOCUMENT]'); - $request = (new GetDocumentRequest()) - ->setName($formattedName); - try { - $gapicClient->getDocument($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchDocumentChunksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $resultsElement = new DocumentChunk(); - $results = [ - $resultsElement, - ]; - $expectedResponse = new SearchDocumentChunksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setResults($results); - $transport->addResponse($expectedResponse); - // Mock request - $query = 'query107944136'; - $request = (new SearchDocumentChunksRequest()) - ->setQuery($query); - $response = $gapicClient->searchDocumentChunks($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getResults()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.developers.knowledge.v1.DeveloperKnowledge/SearchDocumentChunks', $actualFuncCall); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchDocumentChunksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $query = 'query107944136'; - $request = (new SearchDocumentChunksRequest()) - ->setQuery($query); - try { - $gapicClient->searchDocumentChunks($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchGetDocumentsAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchGetDocumentsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedNames = [ - $gapicClient->documentName('[DOCUMENT]'), - ]; - $request = (new BatchGetDocumentsRequest()) - ->setNames($formattedNames); - $response = $gapicClient->batchGetDocumentsAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.developers.knowledge.v1.DeveloperKnowledge/BatchGetDocuments', $actualFuncCall); - $actualValue = $actualRequestObject->getNames(); - $this->assertProtobufEquals($formattedNames, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -}