From b1743ad974481e71abc3f947d94feac51d2c2878 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 19 Aug 2026 22:01:02 +0000 Subject: [PATCH 1/2] feat: You can now filter by `content_length_bytes` feat: You can now filter the grounding corpus for `AnswerQuery` in v1alpha docs: Document names can only be a maximum of 500 characters PiperOrigin-RevId: 967317553 Source-Link: https://github.com/googleapis/googleapis/commit/f1f8a50df5d42f7ac19bd829d4808fb4fa8b2a7d Source-Link: https://github.com/googleapis/googleapis-gen/commit/d8b2558b18d0cdb03b7793513f131c1da91275c2 Copy-Tag: eyJwIjoiRGV2ZWxvcGVyS25vd2xlZGdlLy5Pd2xCb3QueWFtbCIsImgiOiJkOGIyNTU4YjE4ZDBjZGIwM2I3NzkzNTEzZjEzMWMxZGE5MTI3NWMyIn0= --- .../Knowledge/V1/Developerknowledge.php | 29 ++ .../DeveloperKnowledge/V1/Answer.php | 135 +++++++ .../V1/Answer/AnswerCitation.php | 159 ++++++++ .../V1/Answer/AnswerReference.php | 75 ++++ .../V1/Answer/CitationSource.php | 75 ++++ .../V1/Answer/DocumentReference.php | 81 ++++ .../V1/AnswerQueryRequest.php | 68 ++++ .../V1/AnswerQueryResponse.php | 78 ++++ .../V1/BatchGetDocumentsRequest.php | 142 +++++++ .../V1/BatchGetDocumentsResponse.php | 68 ++++ .../DeveloperKnowledge/V1/Document.php | 379 ++++++++++++++++++ .../DeveloperKnowledge/V1/DocumentChunk.php | 252 ++++++++++++ .../DeveloperKnowledge/V1/DocumentView.php | 85 ++++ .../V1/GetDocumentRequest.php | 153 +++++++ .../V1/SearchDocumentChunksRequest.php | 358 +++++++++++++++++ .../V1/SearchDocumentChunksResponse.php | 142 +++++++ .../DeveloperKnowledgeClient/answer_query.php | 70 ++++ .../batch_get_documents.php | 81 ++++ .../DeveloperKnowledgeClient/get_document.php | 76 ++++ .../search_document_chunks.php | 89 ++++ .../V1/Client/DeveloperKnowledgeClient.php | 369 +++++++++++++++++ .../v1/src/V1/gapic_metadata.json | 38 ++ .../developer_knowledge_client_config.json | 54 +++ .../developer_knowledge_descriptor_config.php | 63 +++ ...developer_knowledge_rest_client_config.php | 53 +++ .../Client/DeveloperKnowledgeClientTest.php | 372 +++++++++++++++++ 26 files changed, 3544 insertions(+) create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerCitation.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerReference.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/CitationSource.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/DocumentReference.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryRequest.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryResponse.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsRequest.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsResponse.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Document.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentChunk.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentView.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/GetDocumentRequest.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksRequest.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksResponse.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/answer_query.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php create mode 100644 owl-bot-staging/DeveloperKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php new file mode 100644 index 000000000000..4940dd98090c --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + "\x0A\xFE\x19\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\"\x83\x03\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\x12!\x0A\x14content_length_bytes\x18\x09 \x01(\x05B\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\"w\x0A\x1CSearchDocumentChunksResponse\x12>\x0A\x07results\x18\x01 \x03(\x0B2-.google.developers.knowledge.v1.DocumentChunk\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\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\"(\x0A\x12AnswerQueryRequest\x12\x12\x0A\x05query\x18\x01 \x01(\x09B\x03\xE0A\x02\"M\x0A\x13AnswerQueryResponse\x126\x0A\x06answer\x18\x01 \x01(\x0B2&.google.developers.knowledge.v1.Answer\"\xDB\x04\x0A\x06Answer\x12\x13\x0A\x0Banswer_text\x18\x01 \x01(\x09\x12M\x0A\x09citations\x18\x02 \x03(\x0B25.google.developers.knowledge.v1.Answer.AnswerCitationB\x03\xE0A\x03\x12O\x0A\x0Areferences\x18\x03 \x03(\x0B26.google.developers.knowledge.v1.Answer.AnswerReferenceB\x03\xE0A\x03\x1A\x8F\x01\x0A\x0EAnswerCitation\x12\x18\x0A\x0Bstart_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x12\x16\x0A\x09end_index\x18\x02 \x01(\x05B\x03\xE0A\x03\x12K\x0A\x07sources\x18\x03 \x03(\x0B25.google.developers.knowledge.v1.Answer.CitationSourceB\x03\xE0A\x03\x1A.\x0A\x0ECitationSource\x12\x1C\x0A\x0Freference_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x1Ay\x0A\x0FAnswerReference\x12[\x0A\x12document_reference\x18\x01 \x01(\x0B28.google.developers.knowledge.v1.Answer.DocumentReferenceB\x03\xE0A\x03H\x00B\x09\x0A\x07content\x1A_\x0A\x11DocumentReference\x12J\x0A\x0Edocument_chunk\x18\x01 \x01(\x0B2-.google.developers.knowledge.v1.DocumentChunkB\x03\xE0A\x03\"\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\x81\x06\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\x12\x92\x01\x0A\x0BAnswerQuery\x122.google.developers.knowledge.v1.AnswerQueryRequest\x1A3.google.developers.knowledge.v1.AnswerQueryResponse\"\x1A\x82\xD3\xE4\x93\x02\x14\"\x0F/v1:answerQuery:\x01*\x1AU\xCAA!developerknowledge.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\x83\x02\x0A\"com.google.developers.knowledge.v1B\x17DeveloperKnowledgeProtoP\x01ZAcloud.google.com/go/developerknowledge/apiv1/developerknowledgepb\xAA\x02'Google.Developers.DeveloperKnowledge.V1\xCA\x02'Google\\Developers\\DeveloperKnowledge\\V1\xEA\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer.php new file mode 100644 index 000000000000..efe4a656955c --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer.php @@ -0,0 +1,135 @@ +google.developers.knowledge.v1.Answer + */ +class Answer extends \Google\Protobuf\Internal\Message +{ + /** + * Contains the text of the answer. + * + * Generated from protobuf field string answer_text = 1; + */ + protected $answer_text = ''; + /** + * Output only. Contains citations for the answer. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerCitation citations = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $citations; + /** + * Output only. Contains references for the answer. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerReference references = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $references; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $answer_text + * Contains the text of the answer. + * @type \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerCitation[] $citations + * Output only. Contains citations for the answer. + * @type \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerReference[] $references + * Output only. Contains references for the answer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Contains the text of the answer. + * + * Generated from protobuf field string answer_text = 1; + * @return string + */ + public function getAnswerText() + { + return $this->answer_text; + } + + /** + * Contains the text of the answer. + * + * Generated from protobuf field string answer_text = 1; + * @param string $var + * @return $this + */ + public function setAnswerText($var) + { + GPBUtil::checkString($var, True); + $this->answer_text = $var; + + return $this; + } + + /** + * Output only. Contains citations for the answer. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerCitation citations = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Developers\DeveloperKnowledge\V1\Answer\AnswerCitation> + */ + public function getCitations() + { + return $this->citations; + } + + /** + * Output only. Contains citations for the answer. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerCitation citations = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerCitation[] $var + * @return $this + */ + public function setCitations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerCitation::class); + $this->citations = $arr; + + return $this; + } + + /** + * Output only. Contains references for the answer. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerReference references = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Developers\DeveloperKnowledge\V1\Answer\AnswerReference> + */ + public function getReferences() + { + return $this->references; + } + + /** + * Output only. Contains references for the answer. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerReference references = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerReference[] $var + * @return $this + */ + public function setReferences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerReference::class); + $this->references = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerCitation.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerCitation.php new file mode 100644 index 000000000000..aa08f097c7fd --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerCitation.php @@ -0,0 +1,159 @@ +google.developers.knowledge.v1.Answer.AnswerCitation + */ +class AnswerCitation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Indicates the start of the segment, measured in bytes (UTF-8 + * unicode), inclusive. If there are multi-byte characters, such as + * non-ASCII characters, the index measurement is longer than the string + * length. + * + * Generated from protobuf field int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_index = 0; + /** + * Output only. Indicates the end of the segment, measured in bytes (UTF-8 + * unicode), exclusive. If there are multi-byte characters, such as + * non-ASCII characters, the index measurement is longer than the string + * length. + * + * Generated from protobuf field int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_index = 0; + /** + * Output only. Contains citation sources for the attributed segment. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.CitationSource sources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $sources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start_index + * Output only. Indicates the start of the segment, measured in bytes (UTF-8 + * unicode), inclusive. If there are multi-byte characters, such as + * non-ASCII characters, the index measurement is longer than the string + * length. + * @type int $end_index + * Output only. Indicates the end of the segment, measured in bytes (UTF-8 + * unicode), exclusive. If there are multi-byte characters, such as + * non-ASCII characters, the index measurement is longer than the string + * length. + * @type \Google\Developers\DeveloperKnowledge\V1\Answer\CitationSource[] $sources + * Output only. Contains citation sources for the attributed segment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Indicates the start of the segment, measured in bytes (UTF-8 + * unicode), inclusive. If there are multi-byte characters, such as + * non-ASCII characters, the index measurement is longer than the string + * length. + * + * Generated from protobuf field int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStartIndex() + { + return $this->start_index; + } + + /** + * Output only. Indicates the start of the segment, measured in bytes (UTF-8 + * unicode), inclusive. If there are multi-byte characters, such as + * non-ASCII characters, the index measurement is longer than the string + * length. + * + * Generated from protobuf field int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStartIndex($var) + { + GPBUtil::checkInt32($var); + $this->start_index = $var; + + return $this; + } + + /** + * Output only. Indicates the end of the segment, measured in bytes (UTF-8 + * unicode), exclusive. If there are multi-byte characters, such as + * non-ASCII characters, the index measurement is longer than the string + * length. + * + * Generated from protobuf field int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEndIndex() + { + return $this->end_index; + } + + /** + * Output only. Indicates the end of the segment, measured in bytes (UTF-8 + * unicode), exclusive. If there are multi-byte characters, such as + * non-ASCII characters, the index measurement is longer than the string + * length. + * + * Generated from protobuf field int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEndIndex($var) + { + GPBUtil::checkInt32($var); + $this->end_index = $var; + + return $this; + } + + /** + * Output only. Contains citation sources for the attributed segment. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.CitationSource sources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Developers\DeveloperKnowledge\V1\Answer\CitationSource> + */ + public function getSources() + { + return $this->sources; + } + + /** + * Output only. Contains citation sources for the attributed segment. + * + * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.CitationSource sources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Developers\DeveloperKnowledge\V1\Answer\CitationSource[] $var + * @return $this + */ + public function setSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\Answer\CitationSource::class); + $this->sources = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerReference.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerReference.php new file mode 100644 index 000000000000..8fe6537b1b19 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerReference.php @@ -0,0 +1,75 @@ +google.developers.knowledge.v1.Answer.AnswerReference + */ +class AnswerReference extends \Google\Protobuf\Internal\Message +{ + protected $content; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Developers\DeveloperKnowledge\V1\Answer\DocumentReference $document_reference + * Output only. The reference document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The reference document. + * + * Generated from protobuf field .google.developers.knowledge.v1.Answer.DocumentReference document_reference = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Developers\DeveloperKnowledge\V1\Answer\DocumentReference|null + */ + public function getDocumentReference() + { + return $this->readOneof(1); + } + + public function hasDocumentReference() + { + return $this->hasOneof(1); + } + + /** + * Output only. The reference document. + * + * Generated from protobuf field .google.developers.knowledge.v1.Answer.DocumentReference document_reference = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Developers\DeveloperKnowledge\V1\Answer\DocumentReference $var + * @return $this + */ + public function setDocumentReference($var) + { + GPBUtil::checkMessage($var, \Google\Developers\DeveloperKnowledge\V1\Answer\DocumentReference::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->whichOneof("content"); + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/CitationSource.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/CitationSource.php new file mode 100644 index 000000000000..752d70012852 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/CitationSource.php @@ -0,0 +1,75 @@ +google.developers.knowledge.v1.Answer.CitationSource + */ +class CitationSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Contains the index of the + * [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference] + * in the `references` repeated field. + * + * Generated from protobuf field int32 reference_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reference_index = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $reference_index + * Output only. Contains the index of the + * [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference] + * in the `references` repeated field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Contains the index of the + * [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference] + * in the `references` repeated field. + * + * Generated from protobuf field int32 reference_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getReferenceIndex() + { + return $this->reference_index; + } + + /** + * Output only. Contains the index of the + * [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference] + * in the `references` repeated field. + * + * Generated from protobuf field int32 reference_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setReferenceIndex($var) + { + GPBUtil::checkInt32($var); + $this->reference_index = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/DocumentReference.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/DocumentReference.php new file mode 100644 index 000000000000..56ebee74a4bc --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/DocumentReference.php @@ -0,0 +1,81 @@ +google.developers.knowledge.v1.Answer.DocumentReference + */ +class DocumentReference extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Contains the document chunk. The `document_chunk.id` field + * is not set and will be empty. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentChunk document_chunk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $document_chunk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Developers\DeveloperKnowledge\V1\DocumentChunk $document_chunk + * Output only. Contains the document chunk. The `document_chunk.id` field + * is not set and will be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Contains the document chunk. The `document_chunk.id` field + * is not set and will be empty. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentChunk document_chunk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Developers\DeveloperKnowledge\V1\DocumentChunk|null + */ + public function getDocumentChunk() + { + return $this->document_chunk; + } + + public function hasDocumentChunk() + { + return isset($this->document_chunk); + } + + public function clearDocumentChunk() + { + unset($this->document_chunk); + } + + /** + * Output only. Contains the document chunk. The `document_chunk.id` field + * is not set and will be empty. + * + * Generated from protobuf field .google.developers.knowledge.v1.DocumentChunk document_chunk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Developers\DeveloperKnowledge\V1\DocumentChunk $var + * @return $this + */ + public function setDocumentChunk($var) + { + GPBUtil::checkMessage($var, \Google\Developers\DeveloperKnowledge\V1\DocumentChunk::class); + $this->document_chunk = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryRequest.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryRequest.php new file mode 100644 index 000000000000..8d10dd72f53f --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryRequest.php @@ -0,0 +1,68 @@ +google.developers.knowledge.v1.AnswerQueryRequest + */ +class AnswerQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The query to answer. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * Required. The query to answer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * Required. The query to answer. + * + * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Required. The query to answer. + * + * 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; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryResponse.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryResponse.php new file mode 100644 index 000000000000..9bfdc4f5c4b0 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryResponse.php @@ -0,0 +1,78 @@ +google.developers.knowledge.v1.AnswerQueryResponse + */ +class AnswerQueryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The answer to the query. + * + * Generated from protobuf field .google.developers.knowledge.v1.Answer answer = 1; + */ + protected $answer = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Developers\DeveloperKnowledge\V1\Answer $answer + * The answer to the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); + parent::__construct($data); + } + + /** + * The answer to the query. + * + * Generated from protobuf field .google.developers.knowledge.v1.Answer answer = 1; + * @return \Google\Developers\DeveloperKnowledge\V1\Answer|null + */ + public function getAnswer() + { + return $this->answer; + } + + public function hasAnswer() + { + return isset($this->answer); + } + + public function clearAnswer() + { + unset($this->answer); + } + + /** + * The answer to the query. + * + * Generated from protobuf field .google.developers.knowledge.v1.Answer answer = 1; + * @param \Google\Developers\DeveloperKnowledge\V1\Answer $var + * @return $this + */ + public function setAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Developers\DeveloperKnowledge\V1\Answer::class); + $this->answer = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsRequest.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsRequest.php new file mode 100644 index 000000000000..88abc2f0769f --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsRequest.php @@ -0,0 +1,142 @@ +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` + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * + * 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` + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * @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` + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * + * 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` + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * + * 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\DeveloperKnowledge\V1\DocumentView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsResponse.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsResponse.php new file mode 100644 index 000000000000..94c3d5cacb22 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/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\DeveloperKnowledge\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\DeveloperKnowledge\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\DeveloperKnowledge\V1\Document[] $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\Document::class); + $this->documents = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Document.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Document.php new file mode 100644 index 000000000000..e1e36029d945 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Document.php @@ -0,0 +1,379 @@ +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; + /** + * Output only. The length of the `content` field in bytes. + * + * Generated from protobuf field int32 content_length_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $content_length_bytes = 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. + * @type int $content_length_bytes + * Output only. The length of the `content` field in bytes. + * } + */ + 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\DeveloperKnowledge\V1\DocumentView::class); + $this->view = $var; + + return $this; + } + + /** + * Output only. The length of the `content` field in bytes. + * + * Generated from protobuf field int32 content_length_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getContentLengthBytes() + { + return $this->content_length_bytes; + } + + /** + * Output only. The length of the `content` field in bytes. + * + * Generated from protobuf field int32 content_length_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setContentLengthBytes($var) + { + GPBUtil::checkInt32($var); + $this->content_length_bytes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentChunk.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentChunk.php new file mode 100644 index 000000000000..d49a22587f5d --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/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\DeveloperKnowledge\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\DeveloperKnowledge\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\DeveloperKnowledge\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Developers\DeveloperKnowledge\V1\Document::class); + $this->document = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentView.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentView.php new file mode 100644 index 000000000000..9caf1dbd3897 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentView.php @@ -0,0 +1,85 @@ +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` + * - `content_length_bytes` + * 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/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/GetDocumentRequest.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/GetDocumentRequest.php new file mode 100644 index 000000000000..c257ce300984 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/GetDocumentRequest.php @@ -0,0 +1,153 @@ +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` + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * + * 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` + * + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. Please see + * {@see DeveloperKnowledgeClient::documentName()} for help formatting this field. + * + * @return \Google\Developers\DeveloperKnowledge\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` + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * @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` + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * + * 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` + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * + * 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\DeveloperKnowledge\V1\DocumentView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksRequest.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksRequest.php new file mode 100644 index 000000000000..cee2bad4af4c --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksRequest.php @@ -0,0 +1,358 @@ +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?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. + * + * 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 100; values above 100 will be coerced to 100. + * + * 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: + * * `content_length_bytes` (INTEGER): The length of the `Document.content` + * field in bytes. + * * `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`. + * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. + * 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"`. + * Note: Field names must be in `snake_case` (e.g., `data_source`). Values on + * the right-hand side of filtering expressions must be string literals + * enclosed in double quotes (e.g., `"docs.cloud.google.com"`). + * 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: + * * Filter by `Document.content_length_bytes`: + * `content_length_bytes < 50000` + * * `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?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. + * @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 100; values above 100 will be coerced to 100. + * @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: + * * `content_length_bytes` (INTEGER): The length of the `Document.content` + * field in bytes. + * * `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`. + * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. + * 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"`. + * Note: Field names must be in `snake_case` (e.g., `data_source`). Values on + * the right-hand side of filtering expressions must be string literals + * enclosed in double quotes (e.g., `"docs.cloud.google.com"`). + * 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: + * * Filter by `Document.content_length_bytes`: + * `content_length_bytes < 50000` + * * `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?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. + * + * 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?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. + * + * 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 100; values above 100 will be coerced to 100. + * + * 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 100; values above 100 will be coerced to 100. + * + * 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: + * * `content_length_bytes` (INTEGER): The length of the `Document.content` + * field in bytes. + * * `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`. + * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. + * 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"`. + * Note: Field names must be in `snake_case` (e.g., `data_source`). Values on + * the right-hand side of filtering expressions must be string literals + * enclosed in double quotes (e.g., `"docs.cloud.google.com"`). + * 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: + * * Filter by `Document.content_length_bytes`: + * `content_length_bytes < 50000` + * * `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: + * * `content_length_bytes` (INTEGER): The length of the `Document.content` + * field in bytes. + * * `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`. + * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. + * 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"`. + * Note: Field names must be in `snake_case` (e.g., `data_source`). Values on + * the right-hand side of filtering expressions must be string literals + * enclosed in double quotes (e.g., `"docs.cloud.google.com"`). + * 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: + * * Filter by `Document.content_length_bytes`: + * `content_length_bytes < 50000` + * * `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/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksResponse.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksResponse.php new file mode 100644 index 000000000000..087e2ecde115 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksResponse.php @@ -0,0 +1,142 @@ +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; + /** + * 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; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Developers\DeveloperKnowledge\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 + * 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\DeveloperKnowledge\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\DeveloperKnowledge\V1\DocumentChunk[] $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\DocumentChunk::class); + $this->results = $arr; + + return $this; + } + + /** + * 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; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * 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; + * @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/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/answer_query.php b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/answer_query.php new file mode 100644 index 000000000000..4646c673d364 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/answer_query.php @@ -0,0 +1,70 @@ +setQuery($query); + + // Call the API and handle any network failures. + try { + /** @var AnswerQueryResponse $response */ + $response = $developerKnowledgeClient->answerQuery($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 +{ + $query = '[QUERY]'; + + answer_query_sample($query); +} +// [END developerknowledge_v1_generated_DeveloperKnowledge_AnswerQuery_sync] diff --git a/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php new file mode 100644 index 000000000000..b6bf89d828cd --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php @@ -0,0 +1,81 @@ +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/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php new file mode 100644 index 000000000000..c759247fd781 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php @@ -0,0 +1,76 @@ +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/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php new file mode 100644 index 000000000000..ee96f12c710a --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php @@ -0,0 +1,89 @@ +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/DeveloperKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php new file mode 100644 index 000000000000..221a2dbbe4ef --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php @@ -0,0 +1,369 @@ + answerQueryAsync(AnswerQueryRequest $request, array $optionalArgs = []) + * @method PromiseInterface 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. + * + * @internal + */ + 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\DeveloperKnowledge\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); + } + + /** + * Answers a query using grounded generation. + * + * The async variant is {@see DeveloperKnowledgeClient::answerQueryAsync()} . + * + * @example samples/V1/DeveloperKnowledgeClient/answer_query.php + * + * @param AnswerQueryRequest $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 AnswerQueryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function answerQuery(AnswerQueryRequest $request, array $callOptions = []): AnswerQueryResponse + { + return $this->startApiCall('AnswerQuery', $request, $callOptions)->wait(); + } + + /** + * 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/DeveloperKnowledge/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..b04d6bedafd5 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "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\\DeveloperKnowledge\\V1", + "services": { + "DeveloperKnowledge": { + "clients": { + "grpc": { + "libraryClient": "DeveloperKnowledgeClient", + "rpcs": { + "AnswerQuery": { + "methods": [ + "answerQuery" + ] + }, + "BatchGetDocuments": { + "methods": [ + "batchGetDocuments" + ] + }, + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "SearchDocumentChunks": { + "methods": [ + "searchDocumentChunks" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json new file mode 100644 index 000000000000..30dd2ef5db63 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json @@ -0,0 +1,54 @@ +{ + "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": { + "AnswerQuery": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "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/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php new file mode 100644 index 000000000000..2712db606a2f --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php @@ -0,0 +1,63 @@ + [ + 'google.developers.knowledge.v1.DeveloperKnowledge' => [ + 'AnswerQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Developers\DeveloperKnowledge\V1\AnswerQueryResponse', + ], + 'BatchGetDocuments' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Developers\DeveloperKnowledge\V1\BatchGetDocumentsResponse', + ], + 'GetDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Developers\DeveloperKnowledge\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\DeveloperKnowledge\V1\SearchDocumentChunksResponse', + ], + 'templateMap' => [ + 'document' => 'documents/{document}', + ], + ], + ], +]; diff --git a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php new file mode 100644 index 000000000000..0db6d3ee7df3 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php @@ -0,0 +1,53 @@ + [ + 'google.developers.knowledge.v1.DeveloperKnowledge' => [ + 'AnswerQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v1:answerQuery', + 'body' => '*', + ], + '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/DeveloperKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php b/owl-bot-staging/DeveloperKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php new file mode 100644 index 000000000000..1ab71fd2f4e9 --- /dev/null +++ b/owl-bot-staging/DeveloperKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php @@ -0,0 +1,372 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DeveloperKnowledgeClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DeveloperKnowledgeClient($options); + } + + /** @test */ + public function answerQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AnswerQueryResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $query = 'query107944136'; + $request = (new AnswerQueryRequest()) + ->setQuery($query); + $response = $gapicClient->answerQuery($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/AnswerQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function answerQueryExceptionTest() + { + $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 AnswerQueryRequest()) + ->setQuery($query); + try { + $gapicClient->answerQuery($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 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'; + $contentLengthBytes = 228531160; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $expectedResponse->setUri($uri); + $expectedResponse->setContent($content); + $expectedResponse->setDescription($description); + $expectedResponse->setDataSource($dataSource); + $expectedResponse->setTitle($title); + $expectedResponse->setContentLengthBytes($contentLengthBytes); + $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 answerQueryAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AnswerQueryResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $query = 'query107944136'; + $request = (new AnswerQueryRequest()) + ->setQuery($query); + $response = $gapicClient->answerQueryAsync($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/AnswerQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getQuery(); + $this->assertProtobufEquals($query, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} From f430ba496f31de682daa2a5ad9ec96f55647688b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 19 Aug 2026 22:04:26 +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 +- .../batch_get_documents.php | 3 + .../DeveloperKnowledgeClient/get_document.php | 5 +- .../search_document_chunks.php | 4 +- .../src/V1/BatchGetDocumentsRequest.php | 8 + DeveloperKnowledge/src/V1/Document.php | 4 +- .../src/V1/GetDocumentRequest.php | 13 +- .../src/V1/SearchDocumentChunksRequest.php | 36 +- .../src/V1/SearchDocumentChunksResponse.php | 26 +- .../Knowledge/V1/Developerknowledge.php | 29 -- .../DeveloperKnowledge/V1/Answer.php | 135 ------- .../V1/Answer/AnswerCitation.php | 159 -------- .../V1/Answer/AnswerReference.php | 75 ---- .../V1/Answer/CitationSource.php | 75 ---- .../V1/Answer/DocumentReference.php | 81 ---- .../V1/AnswerQueryRequest.php | 68 ---- .../V1/AnswerQueryResponse.php | 78 ---- .../V1/BatchGetDocumentsRequest.php | 142 ------- .../V1/BatchGetDocumentsResponse.php | 68 ---- .../DeveloperKnowledge/V1/Document.php | 379 ------------------ .../DeveloperKnowledge/V1/DocumentChunk.php | 252 ------------ .../DeveloperKnowledge/V1/DocumentView.php | 85 ---- .../V1/GetDocumentRequest.php | 153 ------- .../V1/SearchDocumentChunksRequest.php | 358 ----------------- .../V1/SearchDocumentChunksResponse.php | 142 ------- .../DeveloperKnowledgeClient/answer_query.php | 70 ---- .../batch_get_documents.php | 81 ---- .../DeveloperKnowledgeClient/get_document.php | 76 ---- .../search_document_chunks.php | 89 ---- .../V1/Client/DeveloperKnowledgeClient.php | 369 ----------------- .../v1/src/V1/gapic_metadata.json | 38 -- .../developer_knowledge_client_config.json | 54 --- .../developer_knowledge_descriptor_config.php | 63 --- ...developer_knowledge_rest_client_config.php | 53 --- .../Client/DeveloperKnowledgeClientTest.php | 372 ----------------- 35 files changed, 81 insertions(+), 3564 deletions(-) delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerCitation.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerReference.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/CitationSource.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/DocumentReference.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryRequest.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryResponse.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsRequest.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsResponse.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Document.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentChunk.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentView.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/GetDocumentRequest.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksRequest.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksResponse.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/answer_query.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php delete mode 100644 owl-bot-staging/DeveloperKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php diff --git a/DeveloperKnowledge/metadata/V1/Developerknowledge.php b/DeveloperKnowledge/metadata/V1/Developerknowledge.php index b6cc3dc75963..4940dd98090c 100644 --- a/DeveloperKnowledge/metadata/V1/Developerknowledge.php +++ b/DeveloperKnowledge/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\x83\x1A\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\"\x83\x03\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\x12!\x0A\x14content_length_bytes\x18\x09 \x01(\x05B\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\"(\x0A\x12AnswerQueryRequest\x12\x12\x0A\x05query\x18\x01 \x01(\x09B\x03\xE0A\x02\"M\x0A\x13AnswerQueryResponse\x126\x0A\x06answer\x18\x01 \x01(\x0B2&.google.developers.knowledge.v1.Answer\"\xDB\x04\x0A\x06Answer\x12\x13\x0A\x0Banswer_text\x18\x01 \x01(\x09\x12M\x0A\x09citations\x18\x02 \x03(\x0B25.google.developers.knowledge.v1.Answer.AnswerCitationB\x03\xE0A\x03\x12O\x0A\x0Areferences\x18\x03 \x03(\x0B26.google.developers.knowledge.v1.Answer.AnswerReferenceB\x03\xE0A\x03\x1A\x8F\x01\x0A\x0EAnswerCitation\x12\x18\x0A\x0Bstart_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x12\x16\x0A\x09end_index\x18\x02 \x01(\x05B\x03\xE0A\x03\x12K\x0A\x07sources\x18\x03 \x03(\x0B25.google.developers.knowledge.v1.Answer.CitationSourceB\x03\xE0A\x03\x1A.\x0A\x0ECitationSource\x12\x1C\x0A\x0Freference_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x1Ay\x0A\x0FAnswerReference\x12[\x0A\x12document_reference\x18\x01 \x01(\x0B28.google.developers.knowledge.v1.Answer.DocumentReferenceB\x03\xE0A\x03H\x00B\x09\x0A\x07content\x1A_\x0A\x11DocumentReference\x12J\x0A\x0Edocument_chunk\x18\x01 \x01(\x0B2-.google.developers.knowledge.v1.DocumentChunkB\x03\xE0A\x03\"\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\x81\x06\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\x12\x92\x01\x0A\x0BAnswerQuery\x122.google.developers.knowledge.v1.AnswerQueryRequest\x1A3.google.developers.knowledge.v1.AnswerQueryResponse\"\x1A\x82\xD3\xE4\x93\x02\x14\"\x0F/v1:answerQuery:\x01*\x1AU\xCAA!developerknowledge.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\x83\x02\x0A\"com.google.developers.knowledge.v1B\x17DeveloperKnowledgeProtoP\x01ZAcloud.google.com/go/developerknowledge/apiv1/developerknowledgepb\xAA\x02'Google.Developers.DeveloperKnowledge.V1\xCA\x02'Google\\Developers\\DeveloperKnowledge\\V1\xEA\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3" + "\x0A\xFE\x19\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\"\x83\x03\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\x12!\x0A\x14content_length_bytes\x18\x09 \x01(\x05B\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\"w\x0A\x1CSearchDocumentChunksResponse\x12>\x0A\x07results\x18\x01 \x03(\x0B2-.google.developers.knowledge.v1.DocumentChunk\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\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\"(\x0A\x12AnswerQueryRequest\x12\x12\x0A\x05query\x18\x01 \x01(\x09B\x03\xE0A\x02\"M\x0A\x13AnswerQueryResponse\x126\x0A\x06answer\x18\x01 \x01(\x0B2&.google.developers.knowledge.v1.Answer\"\xDB\x04\x0A\x06Answer\x12\x13\x0A\x0Banswer_text\x18\x01 \x01(\x09\x12M\x0A\x09citations\x18\x02 \x03(\x0B25.google.developers.knowledge.v1.Answer.AnswerCitationB\x03\xE0A\x03\x12O\x0A\x0Areferences\x18\x03 \x03(\x0B26.google.developers.knowledge.v1.Answer.AnswerReferenceB\x03\xE0A\x03\x1A\x8F\x01\x0A\x0EAnswerCitation\x12\x18\x0A\x0Bstart_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x12\x16\x0A\x09end_index\x18\x02 \x01(\x05B\x03\xE0A\x03\x12K\x0A\x07sources\x18\x03 \x03(\x0B25.google.developers.knowledge.v1.Answer.CitationSourceB\x03\xE0A\x03\x1A.\x0A\x0ECitationSource\x12\x1C\x0A\x0Freference_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x1Ay\x0A\x0FAnswerReference\x12[\x0A\x12document_reference\x18\x01 \x01(\x0B28.google.developers.knowledge.v1.Answer.DocumentReferenceB\x03\xE0A\x03H\x00B\x09\x0A\x07content\x1A_\x0A\x11DocumentReference\x12J\x0A\x0Edocument_chunk\x18\x01 \x01(\x0B2-.google.developers.knowledge.v1.DocumentChunkB\x03\xE0A\x03\"\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\x81\x06\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\x12\x92\x01\x0A\x0BAnswerQuery\x122.google.developers.knowledge.v1.AnswerQueryRequest\x1A3.google.developers.knowledge.v1.AnswerQueryResponse\"\x1A\x82\xD3\xE4\x93\x02\x14\"\x0F/v1:answerQuery:\x01*\x1AU\xCAA!developerknowledge.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\x83\x02\x0A\"com.google.developers.knowledge.v1B\x17DeveloperKnowledgeProtoP\x01ZAcloud.google.com/go/developerknowledge/apiv1/developerknowledgepb\xAA\x02'Google.Developers.DeveloperKnowledge.V1\xCA\x02'Google\\Developers\\DeveloperKnowledge\\V1\xEA\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3" , true); static::$is_initialized = true; diff --git a/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php b/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php index a778eb9627a9..b6bf89d828cd 100644 --- a/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php +++ b/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php @@ -38,6 +38,9 @@ * Format: `documents/{uri_without_scheme}` * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` * + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. + * * Please see {@see DeveloperKnowledgeClient::documentName()} for help formatting this field. */ function batch_get_documents_sample(string $formattedNamesElement): void diff --git a/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/get_document.php b/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/get_document.php index 16d5c083c1c4..c759247fd781 100644 --- a/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/get_document.php +++ b/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/get_document.php @@ -34,7 +34,10 @@ * @param string $formattedName 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. + * + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. Please see + * {@see DeveloperKnowledgeClient::documentName()} for help formatting this field. */ function get_document_sample(string $formattedName): void { diff --git a/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php b/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php index 3ae0b5c92756..ee96f12c710a 100644 --- a/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php +++ b/DeveloperKnowledge/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php @@ -44,7 +44,9 @@ * [SearchDocumentChunksResponse.results][google.developers.knowledge.v1.SearchDocumentChunksResponse.results]. * * @param string $query Provides the raw query string provided by the user, such as "How - * to create a Cloud Storage bucket?". + * to create a Cloud Storage bucket?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. */ function search_document_chunks_sample(string $query): void { diff --git a/DeveloperKnowledge/src/V1/BatchGetDocumentsRequest.php b/DeveloperKnowledge/src/V1/BatchGetDocumentsRequest.php index ffa22bb77e6d..88abc2f0769f 100644 --- a/DeveloperKnowledge/src/V1/BatchGetDocumentsRequest.php +++ b/DeveloperKnowledge/src/V1/BatchGetDocumentsRequest.php @@ -22,6 +22,8 @@ class BatchGetDocumentsRequest extends \Google\Protobuf\Internal\Message * same order as the `names` in the request. * Format: `documents/{uri_without_scheme}` * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. * * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -49,6 +51,8 @@ class BatchGetDocumentsRequest extends \Google\Protobuf\Internal\Message * same order as the `names` in the request. * Format: `documents/{uri_without_scheme}` * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. * @type int $view * Optional. Specifies the * [DocumentView][google.developers.knowledge.v1.DocumentView] of the @@ -68,6 +72,8 @@ public function __construct($data = NULL) { * same order as the `names` in the request. * Format: `documents/{uri_without_scheme}` * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. * * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return RepeatedField @@ -83,6 +89,8 @@ public function getNames() * same order as the `names` in the request. * Format: `documents/{uri_without_scheme}` * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * Each name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. * * Generated from protobuf field repeated string names = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string[] $var diff --git a/DeveloperKnowledge/src/V1/Document.php b/DeveloperKnowledge/src/V1/Document.php index dbd870e36628..e1e36029d945 100644 --- a/DeveloperKnowledge/src/V1/Document.php +++ b/DeveloperKnowledge/src/V1/Document.php @@ -9,7 +9,9 @@ use Google\Protobuf\RepeatedField; /** - * A Document represents a piece of content from the Developer Knowledge corpus. + * A Document represents a page of documentation in the Developer Knowledge + * corpus, like the page at + * https://docs.cloud.google.com/storage/docs/creating-buckets. * * Generated from protobuf message google.developers.knowledge.v1.Document */ diff --git a/DeveloperKnowledge/src/V1/GetDocumentRequest.php b/DeveloperKnowledge/src/V1/GetDocumentRequest.php index 7004692d5f5e..c257ce300984 100644 --- a/DeveloperKnowledge/src/V1/GetDocumentRequest.php +++ b/DeveloperKnowledge/src/V1/GetDocumentRequest.php @@ -20,6 +20,8 @@ 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` + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -39,7 +41,10 @@ class GetDocumentRequest extends \Google\Protobuf\Internal\Message * @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. + * + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. Please see + * {@see DeveloperKnowledgeClient::documentName()} for help formatting this field. * * @return \Google\Developers\DeveloperKnowledge\V1\GetDocumentRequest * @@ -61,6 +66,8 @@ public static function build(string $name): self * Required. Specifies the name of the document to retrieve. * Format: `documents/{uri_without_scheme}` * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. * @type int $view * Optional. Specifies the * [DocumentView][google.developers.knowledge.v1.DocumentView] of the @@ -78,6 +85,8 @@ public function __construct($data = NULL) { * Required. Specifies the name of the document to retrieve. * Format: `documents/{uri_without_scheme}` * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -91,6 +100,8 @@ public function getName() * Required. Specifies the name of the document to retrieve. * Format: `documents/{uri_without_scheme}` * Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` + * The name must not exceed 500 characters; values longer than 500 characters + * will result in an `INVALID_ARGUMENT` error. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DeveloperKnowledge/src/V1/SearchDocumentChunksRequest.php b/DeveloperKnowledge/src/V1/SearchDocumentChunksRequest.php index 59b80acae573..cee2bad4af4c 100644 --- a/DeveloperKnowledge/src/V1/SearchDocumentChunksRequest.php +++ b/DeveloperKnowledge/src/V1/SearchDocumentChunksRequest.php @@ -18,7 +18,9 @@ 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?". + * to create a Cloud Storage bucket?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. * * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -46,6 +48,8 @@ class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter * is applied to `DocumentChunk.document` fields. * Supported fields for filtering: + * * `content_length_bytes` (INTEGER): The length of the `Document.content` + * field in bytes. * * `data_source` (STRING): The source of the document, e.g. * `docs.cloud.google.com`. See * https://developers.google.com/knowledge/reference/corpus-reference for @@ -55,6 +59,7 @@ class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message * markdown content or metadata. * * `uri` (STRING): The document URI, e.g. * `https://docs.cloud.google.com/bigquery/docs/tables`. + * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. * 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. @@ -67,6 +72,8 @@ class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message * operators. `OR` has higher precedence than `AND`. Use parentheses for * explicit precedence grouping. * Examples: + * * Filter by `Document.content_length_bytes`: + * `content_length_bytes < 50000` * * `data_source = "docs.cloud.google.com" OR data_source = * "firebase.google.com"` * * `data_source != "firebase.google.com"` @@ -89,7 +96,9 @@ class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message * * @type string $query * Required. Provides the raw query string provided by the user, such as "How - * to create a Cloud Storage bucket?". + * to create a Cloud Storage bucket?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. * @type int $page_size * Optional. Specifies the maximum number of results to return. The service * may return fewer than this value. @@ -105,6 +114,8 @@ class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter * is applied to `DocumentChunk.document` fields. * Supported fields for filtering: + * * `content_length_bytes` (INTEGER): The length of the `Document.content` + * field in bytes. * * `data_source` (STRING): The source of the document, e.g. * `docs.cloud.google.com`. See * https://developers.google.com/knowledge/reference/corpus-reference for @@ -114,6 +125,7 @@ class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message * markdown content or metadata. * * `uri` (STRING): The document URI, e.g. * `https://docs.cloud.google.com/bigquery/docs/tables`. + * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. * 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. @@ -126,6 +138,8 @@ class SearchDocumentChunksRequest extends \Google\Protobuf\Internal\Message * operators. `OR` has higher precedence than `AND`. Use parentheses for * explicit precedence grouping. * Examples: + * * Filter by `Document.content_length_bytes`: + * `content_length_bytes < 50000` * * `data_source = "docs.cloud.google.com" OR data_source = * "firebase.google.com"` * * `data_source != "firebase.google.com"` @@ -144,7 +158,9 @@ public function __construct($data = NULL) { /** * Required. Provides the raw query string provided by the user, such as "How - * to create a Cloud Storage bucket?". + * to create a Cloud Storage bucket?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. * * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -156,7 +172,9 @@ public function getQuery() /** * Required. Provides the raw query string provided by the user, such as "How - * to create a Cloud Storage bucket?". + * to create a Cloud Storage bucket?". The query must not exceed 500 + * characters; values longer than 500 characters will result in an + * `INVALID_ARGUMENT` error. * * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -237,6 +255,8 @@ public function setPageToken($var) * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter * is applied to `DocumentChunk.document` fields. * Supported fields for filtering: + * * `content_length_bytes` (INTEGER): The length of the `Document.content` + * field in bytes. * * `data_source` (STRING): The source of the document, e.g. * `docs.cloud.google.com`. See * https://developers.google.com/knowledge/reference/corpus-reference for @@ -246,6 +266,7 @@ public function setPageToken($var) * markdown content or metadata. * * `uri` (STRING): The document URI, e.g. * `https://docs.cloud.google.com/bigquery/docs/tables`. + * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. * 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. @@ -258,6 +279,8 @@ public function setPageToken($var) * operators. `OR` has higher precedence than `AND`. Use parentheses for * explicit precedence grouping. * Examples: + * * Filter by `Document.content_length_bytes`: + * `content_length_bytes < 50000` * * `data_source = "docs.cloud.google.com" OR data_source = * "firebase.google.com"` * * `data_source != "firebase.google.com"` @@ -283,6 +306,8 @@ public function getFilter() * [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter * is applied to `DocumentChunk.document` fields. * Supported fields for filtering: + * * `content_length_bytes` (INTEGER): The length of the `Document.content` + * field in bytes. * * `data_source` (STRING): The source of the document, e.g. * `docs.cloud.google.com`. See * https://developers.google.com/knowledge/reference/corpus-reference for @@ -292,6 +317,7 @@ public function getFilter() * markdown content or metadata. * * `uri` (STRING): The document URI, e.g. * `https://docs.cloud.google.com/bigquery/docs/tables`. + * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. * 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. @@ -304,6 +330,8 @@ public function getFilter() * operators. `OR` has higher precedence than `AND`. Use parentheses for * explicit precedence grouping. * Examples: + * * Filter by `Document.content_length_bytes`: + * `content_length_bytes < 50000` * * `data_source = "docs.cloud.google.com" OR data_source = * "firebase.google.com"` * * `data_source != "firebase.google.com"` diff --git a/DeveloperKnowledge/src/V1/SearchDocumentChunksResponse.php b/DeveloperKnowledge/src/V1/SearchDocumentChunksResponse.php index b1e0b7d87869..087e2ecde115 100644 --- a/DeveloperKnowledge/src/V1/SearchDocumentChunksResponse.php +++ b/DeveloperKnowledge/src/V1/SearchDocumentChunksResponse.php @@ -31,10 +31,11 @@ class SearchDocumentChunksResponse extends \Google\Protobuf\Internal\Message */ 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. + * 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]; + * Generated from protobuf field string next_page_token = 2; */ protected $next_page_token = ''; @@ -55,8 +56,9 @@ class SearchDocumentChunksResponse extends \Google\Protobuf\Internal\Message * [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. + * 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) { @@ -107,10 +109,11 @@ public function setResults($var) } /** - * 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. + * 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]; + * Generated from protobuf field string next_page_token = 2; * @return string */ public function getNextPageToken() @@ -119,10 +122,11 @@ public function getNextPageToken() } /** - * 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. + * 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]; + * Generated from protobuf field string next_page_token = 2; * @param string $var * @return $this */ diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php deleted file mode 100644 index 4940dd98090c..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/GPBMetadata/Google/Developers/Knowledge/V1/Developerknowledge.php +++ /dev/null @@ -1,29 +0,0 @@ -internalAddGeneratedFile( - "\x0A\xFE\x19\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\"\x83\x03\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\x12!\x0A\x14content_length_bytes\x18\x09 \x01(\x05B\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\"w\x0A\x1CSearchDocumentChunksResponse\x12>\x0A\x07results\x18\x01 \x03(\x0B2-.google.developers.knowledge.v1.DocumentChunk\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\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\"(\x0A\x12AnswerQueryRequest\x12\x12\x0A\x05query\x18\x01 \x01(\x09B\x03\xE0A\x02\"M\x0A\x13AnswerQueryResponse\x126\x0A\x06answer\x18\x01 \x01(\x0B2&.google.developers.knowledge.v1.Answer\"\xDB\x04\x0A\x06Answer\x12\x13\x0A\x0Banswer_text\x18\x01 \x01(\x09\x12M\x0A\x09citations\x18\x02 \x03(\x0B25.google.developers.knowledge.v1.Answer.AnswerCitationB\x03\xE0A\x03\x12O\x0A\x0Areferences\x18\x03 \x03(\x0B26.google.developers.knowledge.v1.Answer.AnswerReferenceB\x03\xE0A\x03\x1A\x8F\x01\x0A\x0EAnswerCitation\x12\x18\x0A\x0Bstart_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x12\x16\x0A\x09end_index\x18\x02 \x01(\x05B\x03\xE0A\x03\x12K\x0A\x07sources\x18\x03 \x03(\x0B25.google.developers.knowledge.v1.Answer.CitationSourceB\x03\xE0A\x03\x1A.\x0A\x0ECitationSource\x12\x1C\x0A\x0Freference_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x1Ay\x0A\x0FAnswerReference\x12[\x0A\x12document_reference\x18\x01 \x01(\x0B28.google.developers.knowledge.v1.Answer.DocumentReferenceB\x03\xE0A\x03H\x00B\x09\x0A\x07content\x1A_\x0A\x11DocumentReference\x12J\x0A\x0Edocument_chunk\x18\x01 \x01(\x0B2-.google.developers.knowledge.v1.DocumentChunkB\x03\xE0A\x03\"\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\x81\x06\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\x12\x92\x01\x0A\x0BAnswerQuery\x122.google.developers.knowledge.v1.AnswerQueryRequest\x1A3.google.developers.knowledge.v1.AnswerQueryResponse\"\x1A\x82\xD3\xE4\x93\x02\x14\"\x0F/v1:answerQuery:\x01*\x1AU\xCAA!developerknowledge.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\x83\x02\x0A\"com.google.developers.knowledge.v1B\x17DeveloperKnowledgeProtoP\x01ZAcloud.google.com/go/developerknowledge/apiv1/developerknowledgepb\xAA\x02'Google.Developers.DeveloperKnowledge.V1\xCA\x02'Google\\Developers\\DeveloperKnowledge\\V1\xEA\x02*Google::Developers::DeveloperKnowledge::V1b\x06proto3" - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer.php deleted file mode 100644 index efe4a656955c..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer.php +++ /dev/null @@ -1,135 +0,0 @@ -google.developers.knowledge.v1.Answer - */ -class Answer extends \Google\Protobuf\Internal\Message -{ - /** - * Contains the text of the answer. - * - * Generated from protobuf field string answer_text = 1; - */ - protected $answer_text = ''; - /** - * Output only. Contains citations for the answer. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerCitation citations = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $citations; - /** - * Output only. Contains references for the answer. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerReference references = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $references; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $answer_text - * Contains the text of the answer. - * @type \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerCitation[] $citations - * Output only. Contains citations for the answer. - * @type \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerReference[] $references - * Output only. Contains references for the answer. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Contains the text of the answer. - * - * Generated from protobuf field string answer_text = 1; - * @return string - */ - public function getAnswerText() - { - return $this->answer_text; - } - - /** - * Contains the text of the answer. - * - * Generated from protobuf field string answer_text = 1; - * @param string $var - * @return $this - */ - public function setAnswerText($var) - { - GPBUtil::checkString($var, True); - $this->answer_text = $var; - - return $this; - } - - /** - * Output only. Contains citations for the answer. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerCitation citations = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return RepeatedField<\Google\Developers\DeveloperKnowledge\V1\Answer\AnswerCitation> - */ - public function getCitations() - { - return $this->citations; - } - - /** - * Output only. Contains citations for the answer. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerCitation citations = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerCitation[] $var - * @return $this - */ - public function setCitations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerCitation::class); - $this->citations = $arr; - - return $this; - } - - /** - * Output only. Contains references for the answer. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerReference references = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return RepeatedField<\Google\Developers\DeveloperKnowledge\V1\Answer\AnswerReference> - */ - public function getReferences() - { - return $this->references; - } - - /** - * Output only. Contains references for the answer. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.AnswerReference references = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerReference[] $var - * @return $this - */ - public function setReferences($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\Answer\AnswerReference::class); - $this->references = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerCitation.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerCitation.php deleted file mode 100644 index aa08f097c7fd..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerCitation.php +++ /dev/null @@ -1,159 +0,0 @@ -google.developers.knowledge.v1.Answer.AnswerCitation - */ -class AnswerCitation extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Indicates the start of the segment, measured in bytes (UTF-8 - * unicode), inclusive. If there are multi-byte characters, such as - * non-ASCII characters, the index measurement is longer than the string - * length. - * - * Generated from protobuf field int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $start_index = 0; - /** - * Output only. Indicates the end of the segment, measured in bytes (UTF-8 - * unicode), exclusive. If there are multi-byte characters, such as - * non-ASCII characters, the index measurement is longer than the string - * length. - * - * Generated from protobuf field int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_index = 0; - /** - * Output only. Contains citation sources for the attributed segment. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.CitationSource sources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $sources; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $start_index - * Output only. Indicates the start of the segment, measured in bytes (UTF-8 - * unicode), inclusive. If there are multi-byte characters, such as - * non-ASCII characters, the index measurement is longer than the string - * length. - * @type int $end_index - * Output only. Indicates the end of the segment, measured in bytes (UTF-8 - * unicode), exclusive. If there are multi-byte characters, such as - * non-ASCII characters, the index measurement is longer than the string - * length. - * @type \Google\Developers\DeveloperKnowledge\V1\Answer\CitationSource[] $sources - * Output only. Contains citation sources for the attributed segment. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Indicates the start of the segment, measured in bytes (UTF-8 - * unicode), inclusive. If there are multi-byte characters, such as - * non-ASCII characters, the index measurement is longer than the string - * length. - * - * Generated from protobuf field int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getStartIndex() - { - return $this->start_index; - } - - /** - * Output only. Indicates the start of the segment, measured in bytes (UTF-8 - * unicode), inclusive. If there are multi-byte characters, such as - * non-ASCII characters, the index measurement is longer than the string - * length. - * - * Generated from protobuf field int32 start_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setStartIndex($var) - { - GPBUtil::checkInt32($var); - $this->start_index = $var; - - return $this; - } - - /** - * Output only. Indicates the end of the segment, measured in bytes (UTF-8 - * unicode), exclusive. If there are multi-byte characters, such as - * non-ASCII characters, the index measurement is longer than the string - * length. - * - * Generated from protobuf field int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getEndIndex() - { - return $this->end_index; - } - - /** - * Output only. Indicates the end of the segment, measured in bytes (UTF-8 - * unicode), exclusive. If there are multi-byte characters, such as - * non-ASCII characters, the index measurement is longer than the string - * length. - * - * Generated from protobuf field int32 end_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setEndIndex($var) - { - GPBUtil::checkInt32($var); - $this->end_index = $var; - - return $this; - } - - /** - * Output only. Contains citation sources for the attributed segment. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.CitationSource sources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return RepeatedField<\Google\Developers\DeveloperKnowledge\V1\Answer\CitationSource> - */ - public function getSources() - { - return $this->sources; - } - - /** - * Output only. Contains citation sources for the attributed segment. - * - * Generated from protobuf field repeated .google.developers.knowledge.v1.Answer.CitationSource sources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Developers\DeveloperKnowledge\V1\Answer\CitationSource[] $var - * @return $this - */ - public function setSources($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\Answer\CitationSource::class); - $this->sources = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerReference.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerReference.php deleted file mode 100644 index 8fe6537b1b19..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/AnswerReference.php +++ /dev/null @@ -1,75 +0,0 @@ -google.developers.knowledge.v1.Answer.AnswerReference - */ -class AnswerReference extends \Google\Protobuf\Internal\Message -{ - protected $content; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Developers\DeveloperKnowledge\V1\Answer\DocumentReference $document_reference - * Output only. The reference document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The reference document. - * - * Generated from protobuf field .google.developers.knowledge.v1.Answer.DocumentReference document_reference = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Developers\DeveloperKnowledge\V1\Answer\DocumentReference|null - */ - public function getDocumentReference() - { - return $this->readOneof(1); - } - - public function hasDocumentReference() - { - return $this->hasOneof(1); - } - - /** - * Output only. The reference document. - * - * Generated from protobuf field .google.developers.knowledge.v1.Answer.DocumentReference document_reference = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Developers\DeveloperKnowledge\V1\Answer\DocumentReference $var - * @return $this - */ - public function setDocumentReference($var) - { - GPBUtil::checkMessage($var, \Google\Developers\DeveloperKnowledge\V1\Answer\DocumentReference::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getContent() - { - return $this->whichOneof("content"); - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/CitationSource.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/CitationSource.php deleted file mode 100644 index 752d70012852..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/CitationSource.php +++ /dev/null @@ -1,75 +0,0 @@ -google.developers.knowledge.v1.Answer.CitationSource - */ -class CitationSource extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Contains the index of the - * [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference] - * in the `references` repeated field. - * - * Generated from protobuf field int32 reference_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $reference_index = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $reference_index - * Output only. Contains the index of the - * [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference] - * in the `references` repeated field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Contains the index of the - * [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference] - * in the `references` repeated field. - * - * Generated from protobuf field int32 reference_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getReferenceIndex() - { - return $this->reference_index; - } - - /** - * Output only. Contains the index of the - * [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference] - * in the `references` repeated field. - * - * Generated from protobuf field int32 reference_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setReferenceIndex($var) - { - GPBUtil::checkInt32($var); - $this->reference_index = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/DocumentReference.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/DocumentReference.php deleted file mode 100644 index 56ebee74a4bc..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Answer/DocumentReference.php +++ /dev/null @@ -1,81 +0,0 @@ -google.developers.knowledge.v1.Answer.DocumentReference - */ -class DocumentReference extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Contains the document chunk. The `document_chunk.id` field - * is not set and will be empty. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentChunk document_chunk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $document_chunk = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Developers\DeveloperKnowledge\V1\DocumentChunk $document_chunk - * Output only. Contains the document chunk. The `document_chunk.id` field - * is not set and will be empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Contains the document chunk. The `document_chunk.id` field - * is not set and will be empty. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentChunk document_chunk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Developers\DeveloperKnowledge\V1\DocumentChunk|null - */ - public function getDocumentChunk() - { - return $this->document_chunk; - } - - public function hasDocumentChunk() - { - return isset($this->document_chunk); - } - - public function clearDocumentChunk() - { - unset($this->document_chunk); - } - - /** - * Output only. Contains the document chunk. The `document_chunk.id` field - * is not set and will be empty. - * - * Generated from protobuf field .google.developers.knowledge.v1.DocumentChunk document_chunk = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Developers\DeveloperKnowledge\V1\DocumentChunk $var - * @return $this - */ - public function setDocumentChunk($var) - { - GPBUtil::checkMessage($var, \Google\Developers\DeveloperKnowledge\V1\DocumentChunk::class); - $this->document_chunk = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryRequest.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryRequest.php deleted file mode 100644 index 8d10dd72f53f..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryRequest.php +++ /dev/null @@ -1,68 +0,0 @@ -google.developers.knowledge.v1.AnswerQueryRequest - */ -class AnswerQueryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The query to answer. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $query = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query - * Required. The query to answer. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * Required. The query to answer. - * - * Generated from protobuf field string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getQuery() - { - return $this->query; - } - - /** - * Required. The query to answer. - * - * 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; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryResponse.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryResponse.php deleted file mode 100644 index 9bfdc4f5c4b0..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/AnswerQueryResponse.php +++ /dev/null @@ -1,78 +0,0 @@ -google.developers.knowledge.v1.AnswerQueryResponse - */ -class AnswerQueryResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The answer to the query. - * - * Generated from protobuf field .google.developers.knowledge.v1.Answer answer = 1; - */ - protected $answer = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Developers\DeveloperKnowledge\V1\Answer $answer - * The answer to the query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Developers\Knowledge\V1\Developerknowledge::initOnce(); - parent::__construct($data); - } - - /** - * The answer to the query. - * - * Generated from protobuf field .google.developers.knowledge.v1.Answer answer = 1; - * @return \Google\Developers\DeveloperKnowledge\V1\Answer|null - */ - public function getAnswer() - { - return $this->answer; - } - - public function hasAnswer() - { - return isset($this->answer); - } - - public function clearAnswer() - { - unset($this->answer); - } - - /** - * The answer to the query. - * - * Generated from protobuf field .google.developers.knowledge.v1.Answer answer = 1; - * @param \Google\Developers\DeveloperKnowledge\V1\Answer $var - * @return $this - */ - public function setAnswer($var) - { - GPBUtil::checkMessage($var, \Google\Developers\DeveloperKnowledge\V1\Answer::class); - $this->answer = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsRequest.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsRequest.php deleted file mode 100644 index 88abc2f0769f..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsRequest.php +++ /dev/null @@ -1,142 +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` - * Each name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. - * - * 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` - * Each name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. - * @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` - * Each name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. - * - * 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` - * Each name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. - * - * 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\DeveloperKnowledge\V1\DocumentView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsResponse.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/BatchGetDocumentsResponse.php deleted file mode 100644 index 94c3d5cacb22..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/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\DeveloperKnowledge\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\DeveloperKnowledge\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\DeveloperKnowledge\V1\Document[] $var - * @return $this - */ - public function setDocuments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\Document::class); - $this->documents = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Document.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Document.php deleted file mode 100644 index e1e36029d945..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/Document.php +++ /dev/null @@ -1,379 +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; - /** - * Output only. The length of the `content` field in bytes. - * - * Generated from protobuf field int32 content_length_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $content_length_bytes = 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. - * @type int $content_length_bytes - * Output only. The length of the `content` field in bytes. - * } - */ - 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\DeveloperKnowledge\V1\DocumentView::class); - $this->view = $var; - - return $this; - } - - /** - * Output only. The length of the `content` field in bytes. - * - * Generated from protobuf field int32 content_length_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getContentLengthBytes() - { - return $this->content_length_bytes; - } - - /** - * Output only. The length of the `content` field in bytes. - * - * Generated from protobuf field int32 content_length_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setContentLengthBytes($var) - { - GPBUtil::checkInt32($var); - $this->content_length_bytes = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentChunk.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentChunk.php deleted file mode 100644 index d49a22587f5d..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/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\DeveloperKnowledge\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\DeveloperKnowledge\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\DeveloperKnowledge\V1\Document $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkMessage($var, \Google\Developers\DeveloperKnowledge\V1\Document::class); - $this->document = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentView.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentView.php deleted file mode 100644 index 9caf1dbd3897..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/DocumentView.php +++ /dev/null @@ -1,85 +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` - * - `content_length_bytes` - * 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/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/GetDocumentRequest.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/GetDocumentRequest.php deleted file mode 100644 index c257ce300984..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/GetDocumentRequest.php +++ /dev/null @@ -1,153 +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` - * The name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. - * - * 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` - * - * The name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. Please see - * {@see DeveloperKnowledgeClient::documentName()} for help formatting this field. - * - * @return \Google\Developers\DeveloperKnowledge\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` - * The name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. - * @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` - * The name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. - * - * 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` - * The name must not exceed 500 characters; values longer than 500 characters - * will result in an `INVALID_ARGUMENT` error. - * - * 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\DeveloperKnowledge\V1\DocumentView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksRequest.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksRequest.php deleted file mode 100644 index cee2bad4af4c..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksRequest.php +++ /dev/null @@ -1,358 +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?". The query must not exceed 500 - * characters; values longer than 500 characters will result in an - * `INVALID_ARGUMENT` error. - * - * 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 100; values above 100 will be coerced to 100. - * - * 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: - * * `content_length_bytes` (INTEGER): The length of the `Document.content` - * field in bytes. - * * `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`. - * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. - * 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"`. - * Note: Field names must be in `snake_case` (e.g., `data_source`). Values on - * the right-hand side of filtering expressions must be string literals - * enclosed in double quotes (e.g., `"docs.cloud.google.com"`). - * 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: - * * Filter by `Document.content_length_bytes`: - * `content_length_bytes < 50000` - * * `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?". The query must not exceed 500 - * characters; values longer than 500 characters will result in an - * `INVALID_ARGUMENT` error. - * @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 100; values above 100 will be coerced to 100. - * @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: - * * `content_length_bytes` (INTEGER): The length of the `Document.content` - * field in bytes. - * * `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`. - * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. - * 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"`. - * Note: Field names must be in `snake_case` (e.g., `data_source`). Values on - * the right-hand side of filtering expressions must be string literals - * enclosed in double quotes (e.g., `"docs.cloud.google.com"`). - * 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: - * * Filter by `Document.content_length_bytes`: - * `content_length_bytes < 50000` - * * `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?". The query must not exceed 500 - * characters; values longer than 500 characters will result in an - * `INVALID_ARGUMENT` error. - * - * 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?". The query must not exceed 500 - * characters; values longer than 500 characters will result in an - * `INVALID_ARGUMENT` error. - * - * 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 100; values above 100 will be coerced to 100. - * - * 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 100; values above 100 will be coerced to 100. - * - * 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: - * * `content_length_bytes` (INTEGER): The length of the `Document.content` - * field in bytes. - * * `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`. - * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. - * 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"`. - * Note: Field names must be in `snake_case` (e.g., `data_source`). Values on - * the right-hand side of filtering expressions must be string literals - * enclosed in double quotes (e.g., `"docs.cloud.google.com"`). - * 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: - * * Filter by `Document.content_length_bytes`: - * `content_length_bytes < 50000` - * * `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: - * * `content_length_bytes` (INTEGER): The length of the `Document.content` - * field in bytes. - * * `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`. - * INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators. - * 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"`. - * Note: Field names must be in `snake_case` (e.g., `data_source`). Values on - * the right-hand side of filtering expressions must be string literals - * enclosed in double quotes (e.g., `"docs.cloud.google.com"`). - * 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: - * * Filter by `Document.content_length_bytes`: - * `content_length_bytes < 50000` - * * `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/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksResponse.php b/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksResponse.php deleted file mode 100644 index 087e2ecde115..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/proto/src/Google/Developers/DeveloperKnowledge/V1/SearchDocumentChunksResponse.php +++ /dev/null @@ -1,142 +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; - /** - * 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; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Developers\DeveloperKnowledge\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 - * 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\DeveloperKnowledge\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\DeveloperKnowledge\V1\DocumentChunk[] $var - * @return $this - */ - public function setResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Developers\DeveloperKnowledge\V1\DocumentChunk::class); - $this->results = $arr; - - return $this; - } - - /** - * 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; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * 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; - * @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/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/answer_query.php b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/answer_query.php deleted file mode 100644 index 4646c673d364..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/answer_query.php +++ /dev/null @@ -1,70 +0,0 @@ -setQuery($query); - - // Call the API and handle any network failures. - try { - /** @var AnswerQueryResponse $response */ - $response = $developerKnowledgeClient->answerQuery($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 -{ - $query = '[QUERY]'; - - answer_query_sample($query); -} -// [END developerknowledge_v1_generated_DeveloperKnowledge_AnswerQuery_sync] diff --git a/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php deleted file mode 100644 index b6bf89d828cd..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/batch_get_documents.php +++ /dev/null @@ -1,81 +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/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php deleted file mode 100644 index c759247fd781..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/get_document.php +++ /dev/null @@ -1,76 +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/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php b/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php deleted file mode 100644 index ee96f12c710a..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/samples/V1/DeveloperKnowledgeClient/search_document_chunks.php +++ /dev/null @@ -1,89 +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/DeveloperKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php deleted file mode 100644 index 221a2dbbe4ef..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/Client/DeveloperKnowledgeClient.php +++ /dev/null @@ -1,369 +0,0 @@ - answerQueryAsync(AnswerQueryRequest $request, array $optionalArgs = []) - * @method PromiseInterface 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. - * - * @internal - */ - 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\DeveloperKnowledge\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); - } - - /** - * Answers a query using grounded generation. - * - * The async variant is {@see DeveloperKnowledgeClient::answerQueryAsync()} . - * - * @example samples/V1/DeveloperKnowledgeClient/answer_query.php - * - * @param AnswerQueryRequest $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 AnswerQueryResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function answerQuery(AnswerQueryRequest $request, array $callOptions = []): AnswerQueryResponse - { - return $this->startApiCall('AnswerQuery', $request, $callOptions)->wait(); - } - - /** - * 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/DeveloperKnowledge/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/gapic_metadata.json deleted file mode 100644 index b04d6bedafd5..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,38 +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\\DeveloperKnowledge\\V1", - "services": { - "DeveloperKnowledge": { - "clients": { - "grpc": { - "libraryClient": "DeveloperKnowledgeClient", - "rpcs": { - "AnswerQuery": { - "methods": [ - "answerQuery" - ] - }, - "BatchGetDocuments": { - "methods": [ - "batchGetDocuments" - ] - }, - "GetDocument": { - "methods": [ - "getDocument" - ] - }, - "SearchDocumentChunks": { - "methods": [ - "searchDocumentChunks" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json deleted file mode 100644 index 30dd2ef5db63..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_client_config.json +++ /dev/null @@ -1,54 +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": { - "AnswerQuery": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "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/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php deleted file mode 100644 index 2712db606a2f..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_descriptor_config.php +++ /dev/null @@ -1,63 +0,0 @@ - [ - 'google.developers.knowledge.v1.DeveloperKnowledge' => [ - 'AnswerQuery' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Developers\DeveloperKnowledge\V1\AnswerQueryResponse', - ], - 'BatchGetDocuments' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Developers\DeveloperKnowledge\V1\BatchGetDocumentsResponse', - ], - 'GetDocument' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Developers\DeveloperKnowledge\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\DeveloperKnowledge\V1\SearchDocumentChunksResponse', - ], - 'templateMap' => [ - 'document' => 'documents/{document}', - ], - ], - ], -]; diff --git a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php b/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php deleted file mode 100644 index 0db6d3ee7df3..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/src/V1/resources/developer_knowledge_rest_client_config.php +++ /dev/null @@ -1,53 +0,0 @@ - [ - 'google.developers.knowledge.v1.DeveloperKnowledge' => [ - 'AnswerQuery' => [ - 'method' => 'post', - 'uriTemplate' => '/v1:answerQuery', - 'body' => '*', - ], - '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/DeveloperKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php b/owl-bot-staging/DeveloperKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php deleted file mode 100644 index 1ab71fd2f4e9..000000000000 --- a/owl-bot-staging/DeveloperKnowledge/v1/tests/Unit/V1/Client/DeveloperKnowledgeClientTest.php +++ /dev/null @@ -1,372 +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 answerQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AnswerQueryResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $query = 'query107944136'; - $request = (new AnswerQueryRequest()) - ->setQuery($query); - $response = $gapicClient->answerQuery($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/AnswerQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function answerQueryExceptionTest() - { - $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 AnswerQueryRequest()) - ->setQuery($query); - try { - $gapicClient->answerQuery($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 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'; - $contentLengthBytes = 228531160; - $expectedResponse = new Document(); - $expectedResponse->setName($name2); - $expectedResponse->setUri($uri); - $expectedResponse->setContent($content); - $expectedResponse->setDescription($description); - $expectedResponse->setDataSource($dataSource); - $expectedResponse->setTitle($title); - $expectedResponse->setContentLengthBytes($contentLengthBytes); - $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 answerQueryAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AnswerQueryResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $query = 'query107944136'; - $request = (new AnswerQueryRequest()) - ->setQuery($query); - $response = $gapicClient->answerQueryAsync($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/AnswerQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getQuery(); - $this->assertProtobufEquals($query, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -}