gestione documentale avanzata 1 parte

This commit is contained in:
2026-05-28 09:34:28 +02:00
parent 3471befb1a
commit f2b0833b90
34482 changed files with 4312269 additions and 546 deletions
@@ -0,0 +1,48 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge;
class Answer extends \Google\Model
{
/**
* The text of the answer.
*
* @var string
*/
public $answerText;
/**
* The text of the answer.
*
* @param string $answerText
*/
public function setAnswerText($answerText)
{
$this->answerText = $answerText;
}
/**
* @return string
*/
public function getAnswerText()
{
return $this->answerText;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Answer::class, 'Google_Service_DeveloperKnowledge_Answer');
@@ -0,0 +1,48 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge;
class AnswerQueryRequest extends \Google\Model
{
/**
* Required. The query to answer.
*
* @var string
*/
public $query;
/**
* Required. The query to answer.
*
* @param string $query
*/
public function setQuery($query)
{
$this->query = $query;
}
/**
* @return string
*/
public function getQuery()
{
return $this->query;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AnswerQueryRequest::class, 'Google_Service_DeveloperKnowledge_AnswerQueryRequest');
@@ -0,0 +1,44 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge;
class AnswerQueryResponse extends \Google\Model
{
protected $answerType = Answer::class;
protected $answerDataType = '';
/**
* The answer to the query.
*
* @param Answer $answer
*/
public function setAnswer(Answer $answer)
{
$this->answer = $answer;
}
/**
* @return Answer
*/
public function getAnswer()
{
return $this->answer;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AnswerQueryResponse::class, 'Google_Service_DeveloperKnowledge_AnswerQueryResponse');
@@ -0,0 +1,45 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge;
class BatchGetDocumentsResponse extends \Google\Collection
{
protected $collection_key = 'documents';
protected $documentsType = Document::class;
protected $documentsDataType = 'array';
/**
* Contains the documents requested.
*
* @param Document[] $documents
*/
public function setDocuments($documents)
{
$this->documents = $documents;
}
/**
* @return Document[]
*/
public function getDocuments()
{
return $this->documents;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BatchGetDocumentsResponse::class, 'Google_Service_DeveloperKnowledge_BatchGetDocumentsResponse');
@@ -0,0 +1,236 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge;
class Document extends \Google\Model
{
/**
* The default / unset value. See each API method for its default value if
* DocumentView is not specified.
*/
public const VIEW_DOCUMENT_VIEW_UNSPECIFIED = 'DOCUMENT_VIEW_UNSPECIFIED';
/**
* Includes only the basic metadata fields: - `name` - `uri` - `data_source` -
* `title` - `description` - `update_time` - `view` This is the default of
* view for DeveloperKnowledge.SearchDocumentChunks.
*/
public const VIEW_DOCUMENT_VIEW_BASIC = 'DOCUMENT_VIEW_BASIC';
/**
* Includes all Document fields.
*/
public const VIEW_DOCUMENT_VIEW_FULL = 'DOCUMENT_VIEW_FULL';
/**
* Includes the `DOCUMENT_VIEW_BASIC` fields and the `content` field. This is
* the default of view for DeveloperKnowledge.GetDocument and
* DeveloperKnowledge.BatchGetDocuments.
*/
public const VIEW_DOCUMENT_VIEW_CONTENT = 'DOCUMENT_VIEW_CONTENT';
/**
* Output only. Contains the full content of the document in Markdown format.
*
* @var string
*/
public $content;
/**
* Output only. Specifies the data source of the document. Example data
* source: `firebase.google.com`
*
* @var string
*/
public $dataSource;
/**
* Output only. Provides a description of the document.
*
* @var string
*/
public $description;
/**
* Identifier. Contains the resource name of the document. Format:
* `documents/{uri_without_scheme}` Example:
* `documents/docs.cloud.google.com/storage/docs/creating-buckets`
*
* @var string
*/
public $name;
/**
* Output only. Provides the title of the document.
*
* @var string
*/
public $title;
/**
* Output only. Represents the timestamp when the content or metadata of the
* document was last updated.
*
* @var string
*/
public $updateTime;
/**
* Output only. Provides the URI of the content, such as
* `docs.cloud.google.com/storage/docs/creating-buckets`.
*
* @var string
*/
public $uri;
/**
* Output only. Specifies the DocumentView of the document.
*
* @var string
*/
public $view;
/**
* Output only. Contains the full content of the document in Markdown format.
*
* @param string $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Output only. Specifies the data source of the document. Example data
* source: `firebase.google.com`
*
* @param string $dataSource
*/
public function setDataSource($dataSource)
{
$this->dataSource = $dataSource;
}
/**
* @return string
*/
public function getDataSource()
{
return $this->dataSource;
}
/**
* Output only. Provides a description of the document.
*
* @param string $description
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Identifier. Contains the resource name of the document. Format:
* `documents/{uri_without_scheme}` Example:
* `documents/docs.cloud.google.com/storage/docs/creating-buckets`
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Output only. Provides the title of the document.
*
* @param string $title
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Output only. Represents the timestamp when the content or metadata of the
* document was last updated.
*
* @param string $updateTime
*/
public function setUpdateTime($updateTime)
{
$this->updateTime = $updateTime;
}
/**
* @return string
*/
public function getUpdateTime()
{
return $this->updateTime;
}
/**
* Output only. Provides the URI of the content, such as
* `docs.cloud.google.com/storage/docs/creating-buckets`.
*
* @param string $uri
*/
public function setUri($uri)
{
$this->uri = $uri;
}
/**
* @return string
*/
public function getUri()
{
return $this->uri;
}
/**
* Output only. Specifies the DocumentView of the document.
*
* Accepted values: DOCUMENT_VIEW_UNSPECIFIED, DOCUMENT_VIEW_BASIC,
* DOCUMENT_VIEW_FULL, DOCUMENT_VIEW_CONTENT
*
* @param self::VIEW_* $view
*/
public function setView($view)
{
$this->view = $view;
}
/**
* @return self::VIEW_*
*/
public function getView()
{
return $this->view;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Document::class, 'Google_Service_DeveloperKnowledge_Document');
@@ -0,0 +1,124 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge;
class DocumentChunk extends \Google\Model
{
/**
* Output only. Contains the content of the document chunk.
*
* @var string
*/
public $content;
protected $documentType = Document::class;
protected $documentDataType = '';
/**
* 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.
*
* @var string
*/
public $id;
/**
* 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`
*
* @var string
*/
public $parent;
/**
* Output only. Contains the content of the document chunk.
*
* @param string $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Output only. Represents metadata about the Document this chunk is from. The
* DocumentView of this 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 or DeveloperKnowledge.BatchGetDocuments if
* they only need the metadata fields. Otherwise, clients should use
* DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to
* fetch the full document content.
*
* @param Document $document
*/
public function setDocument(Document $document)
{
$this->document = $document;
}
/**
* @return Document
*/
public function getDocument()
{
return $this->document;
}
/**
* 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.
*
* @param string $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* 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`
*
* @param string $parent
*/
public function setParent($parent)
{
$this->parent = $parent;
}
/**
* @return string
*/
public function getParent()
{
return $this->parent;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DocumentChunk::class, 'Google_Service_DeveloperKnowledge_DocumentChunk');
@@ -0,0 +1,136 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge\Resource;
use Google\Service\DeveloperKnowledge\BatchGetDocumentsResponse;
use Google\Service\DeveloperKnowledge\Document;
use Google\Service\DeveloperKnowledge\SearchDocumentChunksResponse;
/**
* The "documents" collection of methods.
* Typical usage is:
* <code>
* $developerknowledgeService = new Google\Service\DeveloperKnowledge(...);
* $documents = $developerknowledgeService->documents;
* </code>
*/
class Documents extends \Google\Service\Resource
{
/**
* Retrieves multiple documents, each with its full Markdown content.
* (documents.batchGet)
*
* @param array $optParams Optional parameters.
*
* @opt_param 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` If you are
* changing the batch size, consider the value of `maxConcurrentGCSFetches`
* constant in the service implementation: http://csdepot/google3/devrel/boq/dev
* eloperknowledge/service/developerknowledge.go
* @opt_param string view Optional. Specifies the DocumentView of the document.
* If unspecified, DeveloperKnowledge.BatchGetDocuments defaults to
* `DOCUMENT_VIEW_CONTENT`.
* @return BatchGetDocumentsResponse
* @throws \Google\Service\Exception
*/
public function batchGet($optParams = [])
{
$params = [];
$params = array_merge($params, $optParams);
return $this->call('batchGet', [$params], BatchGetDocumentsResponse::class);
}
/**
* Retrieves a single document with its full Markdown content. (documents.get)
*
* @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`
* @param array $optParams Optional parameters.
*
* @opt_param string view Optional. Specifies the DocumentView of the document.
* If unspecified, DeveloperKnowledge.GetDocument defaults to
* `DOCUMENT_VIEW_CONTENT`.
* @return Document
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Document::class);
}
/**
* Searches for developer knowledge across Google's developer documentation.
* Returns DocumentChunks based on the user's query. There may be many chunks
* from the same Document. To retrieve full documents, use
* DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments with
* the DocumentChunk.parent returned in the
* SearchDocumentChunksResponse.results. (documents.searchDocumentChunks)
*
* @param array $optParams Optional parameters.
*
* @opt_param 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
* DocumentChunks, the filter is applied to `DocumentChunk.document` fields.
* Supported fields for filtering: * `data_source` (STRING): The source of the
* document, e.g. `docs.cloud.google.com`. See
* https://developers.google.com/knowledge/reference/corpus-reference for the
* complete list of data sources in the corpus. * `update_time` (TIMESTAMP): The
* timestamp of when the document was last meaningfully updated. A meaningful
* update is one that changes document's markdown content or metadata. * `uri`
* (STRING): The document URI, e.g.
* `https://docs.cloud.google.com/bigquery/docs/tables`. STRING fields support
* `=` (equals) and `!=` (not equals) operators for **exact match** on the whole
* string. Partial match, prefix match, and regexp match are not supported.
* TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. Timestamps
* must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`. You can combine
* expressions using `AND`, `OR`, and `NOT` (or `-`) logical operators. `OR` has
* higher precedence than `AND`. Use parentheses for explicit precedence
* grouping. Examples: * `data_source = "docs.cloud.google.com" OR data_source =
* "firebase.google.com"` * `data_source != "firebase.google.com"` *
* `update_time < "2024-01-01T00:00:00Z"` * `update_time >=
* "2025-01-22T00:00:00Z" AND (data_source = "developer.chrome.com" OR
* data_source = "web.dev")` * `uri = "https://docs.cloud.google.com/release-
* notes"` The `filter` string must not exceed 500 characters; values longer
* than 500 characters will result in an `INVALID_ARGUMENT` error.
* @opt_param int pageSize Optional. Specifies the maximum number of results to
* return. The service may return fewer than this value. If unspecified, at most
* 5 results will be returned. The maximum value is 20; values above 20 will
* result in an INVALID_ARGUMENT error.
* @opt_param string pageToken Optional. Contains a page token, received from a
* previous `SearchDocumentChunks` call. Provide this to retrieve the subsequent
* page.
* @opt_param string query Required. Provides the raw query string provided by
* the user, such as "How to create a Cloud Storage bucket?".
* @return SearchDocumentChunksResponse
* @throws \Google\Service\Exception
*/
public function searchDocumentChunks($optParams = [])
{
$params = [];
$params = array_merge($params, $optParams);
return $this->call('searchDocumentChunks', [$params], SearchDocumentChunksResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Documents::class, 'Google_Service_DeveloperKnowledge_Resource_Documents');
@@ -0,0 +1,50 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge\Resource;
use Google\Service\DeveloperKnowledge\AnswerQueryRequest;
use Google\Service\DeveloperKnowledge\AnswerQueryResponse;
/**
* The "v1alpha" collection of methods.
* Typical usage is:
* <code>
* $developerknowledgeService = new Google\Service\DeveloperKnowledge(...);
* $v1alpha = $developerknowledgeService->v1alpha;
* </code>
*/
class V1alpha extends \Google\Service\Resource
{
/**
* Answers a query using grounded generation. (v1alpha.answerQuery)
*
* @param AnswerQueryRequest $postBody
* @param array $optParams Optional parameters.
* @return AnswerQueryResponse
* @throws \Google\Service\Exception
*/
public function answerQuery(AnswerQueryRequest $postBody, $optParams = [])
{
$params = ['postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('answerQuery', [$params], AnswerQueryResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(V1alpha::class, 'Google_Service_DeveloperKnowledge_Resource_V1alpha');
@@ -0,0 +1,73 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\DeveloperKnowledge;
class SearchDocumentChunksResponse extends \Google\Collection
{
protected $collection_key = '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.
*
* @var string
*/
public $nextPageToken;
protected $resultsType = DocumentChunk::class;
protected $resultsDataType = 'array';
/**
* 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.
*
* @param string $nextPageToken
*/
public function setNextPageToken($nextPageToken)
{
$this->nextPageToken = $nextPageToken;
}
/**
* @return string
*/
public function getNextPageToken()
{
return $this->nextPageToken;
}
/**
* Contains the search results for the given query. Each DocumentChunk in this
* list contains a snippet of content relevant to the search query. Use the
* DocumentChunk.parent field of each result with
* DeveloperKnowledge.GetDocument or DeveloperKnowledge.BatchGetDocuments to
* retrieve the full document content.
*
* @param DocumentChunk[] $results
*/
public function setResults($results)
{
$this->results = $results;
}
/**
* @return DocumentChunk[]
*/
public function getResults()
{
return $this->results;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SearchDocumentChunksResponse::class, 'Google_Service_DeveloperKnowledge_SearchDocumentChunksResponse');