├── .gitattributes ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── MIGRATING.md ├── README.md ├── SECURITY.md ├── VERSION ├── composer.json ├── metadata └── V1 │ ├── Barcode.php │ ├── Document.php │ ├── DocumentIo.php │ ├── DocumentProcessorService.php │ ├── DocumentSchema.php │ ├── Evaluation.php │ ├── Geometry.php │ ├── OperationMetadata.php │ ├── Processor.php │ └── ProcessorType.php └── src └── V1 ├── Barcode.php ├── BatchDocumentsInputConfig.php ├── BatchProcessMetadata.php ├── BatchProcessMetadata ├── IndividualProcessStatus.php └── State.php ├── BatchProcessRequest.php ├── BatchProcessResponse.php ├── BoundingPoly.php ├── Client └── DocumentProcessorServiceClient.php ├── CommonOperationMetadata.php ├── CommonOperationMetadata └── State.php ├── CreateProcessorRequest.php ├── DeleteProcessorMetadata.php ├── DeleteProcessorRequest.php ├── DeleteProcessorVersionMetadata.php ├── DeleteProcessorVersionRequest.php ├── DeployProcessorVersionMetadata.php ├── DeployProcessorVersionRequest.php ├── DeployProcessorVersionResponse.php ├── DisableProcessorMetadata.php ├── DisableProcessorRequest.php ├── DisableProcessorResponse.php ├── Document.php ├── Document ├── ChunkedDocument.php ├── ChunkedDocument │ ├── Chunk.php │ └── Chunk │ │ ├── ChunkPageFooter.php │ │ ├── ChunkPageHeader.php │ │ └── ChunkPageSpan.php ├── DocumentLayout.php ├── DocumentLayout │ ├── DocumentLayoutBlock.php │ └── DocumentLayoutBlock │ │ ├── LayoutListBlock.php │ │ ├── LayoutListEntry.php │ │ ├── LayoutPageSpan.php │ │ ├── LayoutTableBlock.php │ │ ├── LayoutTableCell.php │ │ ├── LayoutTableRow.php │ │ └── LayoutTextBlock.php ├── Entity.php ├── Entity │ └── NormalizedValue.php ├── EntityRelation.php ├── Page.php ├── Page │ ├── Block.php │ ├── DetectedBarcode.php │ ├── DetectedLanguage.php │ ├── Dimension.php │ ├── FormField.php │ ├── Image.php │ ├── ImageQualityScores.php │ ├── ImageQualityScores │ │ └── DetectedDefect.php │ ├── Layout.php │ ├── Layout │ │ └── Orientation.php │ ├── Line.php │ ├── Matrix.php │ ├── Paragraph.php │ ├── Symbol.php │ ├── Table.php │ ├── Table │ │ ├── TableCell.php │ │ └── TableRow.php │ ├── Token.php │ ├── Token │ │ ├── DetectedBreak.php │ │ ├── DetectedBreak │ │ │ └── Type.php │ │ └── StyleInfo.php │ └── VisualElement.php ├── PageAnchor.php ├── PageAnchor │ ├── PageRef.php │ └── PageRef │ │ └── LayoutType.php ├── Provenance.php ├── Provenance │ ├── OperationType.php │ └── PBParent.php ├── Revision.php ├── Revision │ └── HumanReview.php ├── ShardInfo.php ├── Style.php ├── Style │ └── FontSize.php ├── TextAnchor.php ├── TextAnchor │ └── TextSegment.php └── TextChange.php ├── DocumentOutputConfig.php ├── DocumentOutputConfig ├── GcsOutputConfig.php └── GcsOutputConfig │ └── ShardingConfig.php ├── DocumentSchema.php ├── DocumentSchema ├── EntityType.php ├── EntityType │ ├── EnumValues.php │ ├── Property.php │ └── Property │ │ └── OccurrenceType.php └── Metadata.php ├── EnableProcessorMetadata.php ├── EnableProcessorRequest.php ├── EnableProcessorResponse.php ├── EvaluateProcessorVersionMetadata.php ├── EvaluateProcessorVersionRequest.php ├── EvaluateProcessorVersionResponse.php ├── Evaluation.php ├── Evaluation ├── ConfidenceLevelMetrics.php ├── Counters.php ├── Metrics.php ├── MultiConfidenceMetrics.php └── MultiConfidenceMetrics │ └── MetricsType.php ├── EvaluationReference.php ├── FetchProcessorTypesRequest.php ├── FetchProcessorTypesResponse.php ├── GcsDocument.php ├── GcsDocuments.php ├── GcsPrefix.php ├── GetEvaluationRequest.php ├── GetProcessorRequest.php ├── GetProcessorTypeRequest.php ├── GetProcessorVersionRequest.php ├── HumanReviewStatus.php ├── HumanReviewStatus └── State.php ├── ListEvaluationsRequest.php ├── ListEvaluationsResponse.php ├── ListProcessorTypesRequest.php ├── ListProcessorTypesResponse.php ├── ListProcessorVersionsRequest.php ├── ListProcessorVersionsResponse.php ├── ListProcessorsRequest.php ├── ListProcessorsResponse.php ├── NormalizedVertex.php ├── OcrConfig.php ├── OcrConfig ├── Hints.php └── PremiumFeatures.php ├── ProcessOptions.php ├── ProcessOptions ├── IndividualPageSelector.php ├── LayoutConfig.php └── LayoutConfig │ └── ChunkingConfig.php ├── ProcessRequest.php ├── ProcessResponse.php ├── Processor.php ├── Processor └── State.php ├── ProcessorType.php ├── ProcessorType └── LocationInfo.php ├── ProcessorVersion.php ├── ProcessorVersion ├── DeprecationInfo.php ├── GenAiModelInfo.php ├── GenAiModelInfo │ ├── CustomGenAiModelInfo.php │ ├── CustomGenAiModelInfo │ │ └── CustomModelType.php │ └── FoundationGenAiModelInfo.php ├── ModelType.php └── State.php ├── ProcessorVersionAlias.php ├── RawDocument.php ├── ReviewDocumentOperationMetadata.php ├── ReviewDocumentRequest.php ├── ReviewDocumentRequest └── Priority.php ├── ReviewDocumentResponse.php ├── ReviewDocumentResponse └── State.php ├── SetDefaultProcessorVersionMetadata.php ├── SetDefaultProcessorVersionRequest.php ├── SetDefaultProcessorVersionResponse.php ├── TrainProcessorVersionMetadata.php ├── TrainProcessorVersionMetadata └── DatasetValidation.php ├── TrainProcessorVersionRequest.php ├── TrainProcessorVersionRequest ├── CustomDocumentExtractionOptions.php ├── CustomDocumentExtractionOptions │ └── TrainingMethod.php ├── FoundationModelTuningOptions.php └── InputData.php ├── TrainProcessorVersionResponse.php ├── UndeployProcessorVersionMetadata.php ├── UndeployProcessorVersionRequest.php ├── UndeployProcessorVersionResponse.php ├── Vertex.php └── resources ├── document_processor_service_client_config.json ├── document_processor_service_descriptor_config.php └── document_processor_service_rest_client_config.php /.gitattributes: -------------------------------------------------------------------------------- 1 | /*.xml.dist export-ignore 2 | /tests export-ignore 3 | /.github export-ignore 4 | /samples export-ignore 5 | /.OwlBot.yaml export-ignore 6 | /owlbot.py export-ignore 7 | /src/**/gapic_metadata.json export-ignore 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, 4 | and in the interest of fostering an open and welcoming community, 5 | we pledge to respect all people who contribute through reporting issues, 6 | posting feature requests, updating documentation, 7 | submitting pull requests or patches, and other activities. 8 | 9 | We are committed to making participation in this project 10 | a harassment-free experience for everyone, 11 | regardless of level of experience, gender, gender identity and expression, 12 | sexual orientation, disability, personal appearance, 13 | body size, race, ethnicity, age, religion, or nationality. 14 | 15 | Examples of unacceptable behavior by participants include: 16 | 17 | * The use of sexualized language or imagery 18 | * Personal attacks 19 | * Trolling or insulting/derogatory comments 20 | * Public or private harassment 21 | * Publishing other's private information, 22 | such as physical or electronic 23 | addresses, without explicit permission 24 | * Other unethical or unprofessional conduct. 25 | 26 | Project maintainers have the right and responsibility to remove, edit, or reject 27 | comments, commits, code, wiki edits, issues, and other contributions 28 | that are not aligned to this Code of Conduct. 29 | By adopting this Code of Conduct, 30 | project maintainers commit themselves to fairly and consistently 31 | applying these principles to every aspect of managing this project. 32 | Project maintainers who do not follow or enforce the Code of Conduct 33 | may be permanently removed from the project team. 34 | 35 | This code of conduct applies both within project spaces and in public spaces 36 | when an individual is representing the project or its community. 37 | 38 | Instances of abusive, harassing, or otherwise unacceptable behavior 39 | may be reported by opening an issue 40 | or contacting one or more of the project maintainers. 41 | 42 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, 43 | available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. We accept 4 | and review pull requests against the main 5 | [Google Cloud PHP](https://github.com/googleapis/google-cloud-php) 6 | repository, which contains all of our client libraries. You will also need to 7 | sign a Contributor License Agreement. For more details about how to contribute, 8 | see the 9 | [CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) 10 | file in the main Google Cloud PHP repository. 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Google Cloud Document Ai for PHP 2 | 3 | > Idiomatic PHP client for [Google Cloud Document Ai](https://cloud.google.com/document-ai). 4 | 5 | [![Latest Stable Version](https://poser.pugx.org/google/cloud-document-ai/v/stable)](https://packagist.org/packages/google/cloud-document-ai) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-document-ai.svg)](https://packagist.org/packages/google/cloud-document-ai) 6 | 7 | * [API documentation](https://cloud.google.com/php/docs/reference/cloud-document-ai/latest) 8 | 9 | **NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any 10 | support requests, bug reports, or development contributions should be directed to 11 | that project. 12 | 13 | ### Installation 14 | 15 | To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). 16 | 17 | Now install this component: 18 | 19 | ```sh 20 | $ composer require google/cloud-document-ai 21 | ``` 22 | 23 | This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) 24 | please see our [gRPC installation guide](https://cloud.google.com/php/grpc). 25 | 26 | ### Authentication 27 | 28 | Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information 29 | on authenticating your client. Once authenticated, you'll be ready to start making requests. 30 | 31 | ### Debugging 32 | 33 | Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md) 34 | for more information about the debugging tools. 35 | 36 | ### Version 37 | 38 | This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in 39 | any minor or patch releases. We will address issues and requests with the highest priority. 40 | 41 | ### Next Steps 42 | 43 | 1. Understand the [official documentation](https://cloud.google.com/document-ai/docs). 44 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). 4 | 5 | The Google Security Team will respond within 5 working days of your report on g.co/vulnz. 6 | 7 | We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. 8 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 2.2.1 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "google/cloud-document-ai", 3 | "description": "Google Cloud Document Ai Client for PHP", 4 | "license": "Apache-2.0", 5 | "minimum-stability": "stable", 6 | "autoload": { 7 | "psr-4": { 8 | "Google\\Cloud\\DocumentAI\\": "src", 9 | "GPBMetadata\\Google\\Cloud\\Documentai\\": "metadata" 10 | } 11 | }, 12 | "autoload-dev": { 13 | "psr-4": { 14 | "Google\\Cloud\\DocumentAI\\Tests\\": "tests" 15 | } 16 | }, 17 | "extra": { 18 | "component": { 19 | "id": "cloud-document-ai", 20 | "path": "DocumentAi", 21 | "entry": null, 22 | "target": "googleapis/google-cloud-php-document-ai.git" 23 | } 24 | }, 25 | "require": { 26 | "php": "^8.0", 27 | "google/gax": "^1.36.0" 28 | }, 29 | "require-dev": { 30 | "phpunit/phpunit": "^9.0" 31 | }, 32 | "suggest": { 33 | "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", 34 | "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /metadata/V1/Barcode.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/Barcode.php -------------------------------------------------------------------------------- /metadata/V1/Document.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/Document.php -------------------------------------------------------------------------------- /metadata/V1/DocumentIo.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/DocumentIo.php -------------------------------------------------------------------------------- /metadata/V1/DocumentProcessorService.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/DocumentProcessorService.php -------------------------------------------------------------------------------- /metadata/V1/DocumentSchema.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/DocumentSchema.php -------------------------------------------------------------------------------- /metadata/V1/Evaluation.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/Evaluation.php -------------------------------------------------------------------------------- /metadata/V1/Geometry.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/Geometry.php -------------------------------------------------------------------------------- /metadata/V1/OperationMetadata.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/OperationMetadata.php -------------------------------------------------------------------------------- /metadata/V1/Processor.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/Processor.php -------------------------------------------------------------------------------- /metadata/V1/ProcessorType.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-document-ai/7c4dd6bfb944326eba03d9fa48f5114917382331/metadata/V1/ProcessorType.php -------------------------------------------------------------------------------- /src/V1/BatchDocumentsInputConfig.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.BatchDocumentsInputConfig 15 | */ 16 | class BatchDocumentsInputConfig extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $source; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type \Google\Cloud\DocumentAI\V1\GcsPrefix $gcs_prefix 27 | * The set of documents that match the specified Cloud Storage `gcs_prefix`. 28 | * @type \Google\Cloud\DocumentAI\V1\GcsDocuments $gcs_documents 29 | * The set of documents individually specified on Cloud Storage. 30 | * } 31 | */ 32 | public function __construct($data = NULL) { 33 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); 34 | parent::__construct($data); 35 | } 36 | 37 | /** 38 | * The set of documents that match the specified Cloud Storage `gcs_prefix`. 39 | * 40 | * Generated from protobuf field .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; 41 | * @return \Google\Cloud\DocumentAI\V1\GcsPrefix|null 42 | */ 43 | public function getGcsPrefix() 44 | { 45 | return $this->readOneof(1); 46 | } 47 | 48 | public function hasGcsPrefix() 49 | { 50 | return $this->hasOneof(1); 51 | } 52 | 53 | /** 54 | * The set of documents that match the specified Cloud Storage `gcs_prefix`. 55 | * 56 | * Generated from protobuf field .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; 57 | * @param \Google\Cloud\DocumentAI\V1\GcsPrefix $var 58 | * @return $this 59 | */ 60 | public function setGcsPrefix($var) 61 | { 62 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\GcsPrefix::class); 63 | $this->writeOneof(1, $var); 64 | 65 | return $this; 66 | } 67 | 68 | /** 69 | * The set of documents individually specified on Cloud Storage. 70 | * 71 | * Generated from protobuf field .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; 72 | * @return \Google\Cloud\DocumentAI\V1\GcsDocuments|null 73 | */ 74 | public function getGcsDocuments() 75 | { 76 | return $this->readOneof(2); 77 | } 78 | 79 | public function hasGcsDocuments() 80 | { 81 | return $this->hasOneof(2); 82 | } 83 | 84 | /** 85 | * The set of documents individually specified on Cloud Storage. 86 | * 87 | * Generated from protobuf field .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; 88 | * @param \Google\Cloud\DocumentAI\V1\GcsDocuments $var 89 | * @return $this 90 | */ 91 | public function setGcsDocuments($var) 92 | { 93 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\GcsDocuments::class); 94 | $this->writeOneof(2, $var); 95 | 96 | return $this; 97 | } 98 | 99 | /** 100 | * @return string 101 | */ 102 | public function getSource() 103 | { 104 | return $this->whichOneof("source"); 105 | } 106 | 107 | } 108 | 109 | -------------------------------------------------------------------------------- /src/V1/BatchProcessMetadata/State.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.BatchProcessMetadata.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * The default value. This value is used if the state is omitted. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * Request operation is waiting for scheduling. 24 | * 25 | * Generated from protobuf enum WAITING = 1; 26 | */ 27 | const WAITING = 1; 28 | /** 29 | * Request is being processed. 30 | * 31 | * Generated from protobuf enum RUNNING = 2; 32 | */ 33 | const RUNNING = 2; 34 | /** 35 | * The batch processing completed successfully. 36 | * 37 | * Generated from protobuf enum SUCCEEDED = 3; 38 | */ 39 | const SUCCEEDED = 3; 40 | /** 41 | * The batch processing was being cancelled. 42 | * 43 | * Generated from protobuf enum CANCELLING = 4; 44 | */ 45 | const CANCELLING = 4; 46 | /** 47 | * The batch processing was cancelled. 48 | * 49 | * Generated from protobuf enum CANCELLED = 5; 50 | */ 51 | const CANCELLED = 5; 52 | /** 53 | * The batch processing has failed. 54 | * 55 | * Generated from protobuf enum FAILED = 6; 56 | */ 57 | const FAILED = 6; 58 | 59 | private static $valueToName = [ 60 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 61 | self::WAITING => 'WAITING', 62 | self::RUNNING => 'RUNNING', 63 | self::SUCCEEDED => 'SUCCEEDED', 64 | self::CANCELLING => 'CANCELLING', 65 | self::CANCELLED => 'CANCELLED', 66 | self::FAILED => 'FAILED', 67 | ]; 68 | 69 | public static function name($value) 70 | { 71 | if (!isset(self::$valueToName[$value])) { 72 | throw new UnexpectedValueException(sprintf( 73 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 74 | } 75 | return self::$valueToName[$value]; 76 | } 77 | 78 | 79 | public static function value($name) 80 | { 81 | $const = __CLASS__ . '::' . strtoupper($name); 82 | if (!defined($const)) { 83 | throw new UnexpectedValueException(sprintf( 84 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 85 | } 86 | return constant($const); 87 | } 88 | } 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/V1/BatchProcessResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.BatchProcessResponse 16 | */ 17 | class BatchProcessResponse extends \Google\Protobuf\Internal\Message 18 | { 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * } 27 | */ 28 | public function __construct($data = NULL) { 29 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 30 | parent::__construct($data); 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/V1/CommonOperationMetadata/State.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.CommonOperationMetadata.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * Unspecified state. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * Operation is still running. 24 | * 25 | * Generated from protobuf enum RUNNING = 1; 26 | */ 27 | const RUNNING = 1; 28 | /** 29 | * Operation is being cancelled. 30 | * 31 | * Generated from protobuf enum CANCELLING = 2; 32 | */ 33 | const CANCELLING = 2; 34 | /** 35 | * Operation succeeded. 36 | * 37 | * Generated from protobuf enum SUCCEEDED = 3; 38 | */ 39 | const SUCCEEDED = 3; 40 | /** 41 | * Operation failed. 42 | * 43 | * Generated from protobuf enum FAILED = 4; 44 | */ 45 | const FAILED = 4; 46 | /** 47 | * Operation is cancelled. 48 | * 49 | * Generated from protobuf enum CANCELLED = 5; 50 | */ 51 | const CANCELLED = 5; 52 | 53 | private static $valueToName = [ 54 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 55 | self::RUNNING => 'RUNNING', 56 | self::CANCELLING => 'CANCELLING', 57 | self::SUCCEEDED => 'SUCCEEDED', 58 | self::FAILED => 'FAILED', 59 | self::CANCELLED => 'CANCELLED', 60 | ]; 61 | 62 | public static function name($value) 63 | { 64 | if (!isset(self::$valueToName[$value])) { 65 | throw new UnexpectedValueException(sprintf( 66 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 67 | } 68 | return self::$valueToName[$value]; 69 | } 70 | 71 | 72 | public static function value($name) 73 | { 74 | $const = __CLASS__ . '::' . strtoupper($name); 75 | if (!defined($const)) { 76 | throw new UnexpectedValueException(sprintf( 77 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 78 | } 79 | return constant($const); 80 | } 81 | } 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/V1/DeleteProcessorMetadata.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DeleteProcessorMetadata 17 | */ 18 | class DeleteProcessorMetadata extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The basic metadata of the long-running operation. 22 | * 23 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 24 | */ 25 | protected $common_metadata = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata 34 | * The basic metadata of the long-running operation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The basic metadata of the long-running operation. 44 | * 45 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 46 | * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null 47 | */ 48 | public function getCommonMetadata() 49 | { 50 | return $this->common_metadata; 51 | } 52 | 53 | public function hasCommonMetadata() 54 | { 55 | return isset($this->common_metadata); 56 | } 57 | 58 | public function clearCommonMetadata() 59 | { 60 | unset($this->common_metadata); 61 | } 62 | 63 | /** 64 | * The basic metadata of the long-running operation. 65 | * 66 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 67 | * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var 68 | * @return $this 69 | */ 70 | public function setCommonMetadata($var) 71 | { 72 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); 73 | $this->common_metadata = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V1/DeleteProcessorRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DeleteProcessorRequest 17 | */ 18 | class DeleteProcessorRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor resource name to be deleted. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The processor resource name to be deleted. Please see 29 | * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. 30 | * 31 | * @return \Google\Cloud\DocumentAI\V1\DeleteProcessorRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The processor resource name to be deleted. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * Required. The processor resource name to be deleted. 58 | * 59 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 60 | * @return string 61 | */ 62 | public function getName() 63 | { 64 | return $this->name; 65 | } 66 | 67 | /** 68 | * Required. The processor resource name to be deleted. 69 | * 70 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 71 | * @param string $var 72 | * @return $this 73 | */ 74 | public function setName($var) 75 | { 76 | GPBUtil::checkString($var, True); 77 | $this->name = $var; 78 | 79 | return $this; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/V1/DeleteProcessorVersionMetadata.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DeleteProcessorVersionMetadata 17 | */ 18 | class DeleteProcessorVersionMetadata extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The basic metadata of the long-running operation. 22 | * 23 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 24 | */ 25 | protected $common_metadata = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata 34 | * The basic metadata of the long-running operation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The basic metadata of the long-running operation. 44 | * 45 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 46 | * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null 47 | */ 48 | public function getCommonMetadata() 49 | { 50 | return $this->common_metadata; 51 | } 52 | 53 | public function hasCommonMetadata() 54 | { 55 | return isset($this->common_metadata); 56 | } 57 | 58 | public function clearCommonMetadata() 59 | { 60 | unset($this->common_metadata); 61 | } 62 | 63 | /** 64 | * The basic metadata of the long-running operation. 65 | * 66 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 67 | * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var 68 | * @return $this 69 | */ 70 | public function setCommonMetadata($var) 71 | { 72 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); 73 | $this->common_metadata = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V1/DeleteProcessorVersionRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DeleteProcessorVersionRequest 17 | */ 18 | class DeleteProcessorVersionRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor version resource name to be deleted. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The processor version resource name to be deleted. Please see 29 | * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. 30 | * 31 | * @return \Google\Cloud\DocumentAI\V1\DeleteProcessorVersionRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The processor version resource name to be deleted. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * Required. The processor version resource name to be deleted. 58 | * 59 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 60 | * @return string 61 | */ 62 | public function getName() 63 | { 64 | return $this->name; 65 | } 66 | 67 | /** 68 | * Required. The processor version resource name to be deleted. 69 | * 70 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 71 | * @param string $var 72 | * @return $this 73 | */ 74 | public function setName($var) 75 | { 76 | GPBUtil::checkString($var, True); 77 | $this->name = $var; 78 | 79 | return $this; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/V1/DeployProcessorVersionMetadata.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DeployProcessorVersionMetadata 17 | */ 18 | class DeployProcessorVersionMetadata extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The basic metadata of the long-running operation. 22 | * 23 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 24 | */ 25 | protected $common_metadata = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata 34 | * The basic metadata of the long-running operation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The basic metadata of the long-running operation. 44 | * 45 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 46 | * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null 47 | */ 48 | public function getCommonMetadata() 49 | { 50 | return $this->common_metadata; 51 | } 52 | 53 | public function hasCommonMetadata() 54 | { 55 | return isset($this->common_metadata); 56 | } 57 | 58 | public function clearCommonMetadata() 59 | { 60 | unset($this->common_metadata); 61 | } 62 | 63 | /** 64 | * The basic metadata of the long-running operation. 65 | * 66 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 67 | * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var 68 | * @return $this 69 | */ 70 | public function setCommonMetadata($var) 71 | { 72 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); 73 | $this->common_metadata = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V1/DeployProcessorVersionRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DeployProcessorVersionRequest 17 | */ 18 | class DeployProcessorVersionRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor version resource name to be deployed. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The processor version resource name to be deployed. Please see 29 | * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. 30 | * 31 | * @return \Google\Cloud\DocumentAI\V1\DeployProcessorVersionRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The processor version resource name to be deployed. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * Required. The processor version resource name to be deployed. 58 | * 59 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 60 | * @return string 61 | */ 62 | public function getName() 63 | { 64 | return $this->name; 65 | } 66 | 67 | /** 68 | * Required. The processor version resource name to be deployed. 69 | * 70 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 71 | * @param string $var 72 | * @return $this 73 | */ 74 | public function setName($var) 75 | { 76 | GPBUtil::checkString($var, True); 77 | $this->name = $var; 78 | 79 | return $this; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/V1/DeployProcessorVersionResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DeployProcessorVersionResponse 17 | */ 18 | class DeployProcessorVersionResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * } 28 | */ 29 | public function __construct($data = NULL) { 30 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 31 | parent::__construct($data); 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/V1/DisableProcessorMetadata.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DisableProcessorMetadata 17 | */ 18 | class DisableProcessorMetadata extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The basic metadata of the long-running operation. 22 | * 23 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 24 | */ 25 | protected $common_metadata = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata 34 | * The basic metadata of the long-running operation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The basic metadata of the long-running operation. 44 | * 45 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 46 | * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null 47 | */ 48 | public function getCommonMetadata() 49 | { 50 | return $this->common_metadata; 51 | } 52 | 53 | public function hasCommonMetadata() 54 | { 55 | return isset($this->common_metadata); 56 | } 57 | 58 | public function clearCommonMetadata() 59 | { 60 | unset($this->common_metadata); 61 | } 62 | 63 | /** 64 | * The basic metadata of the long-running operation. 65 | * 66 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 67 | * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var 68 | * @return $this 69 | */ 70 | public function setCommonMetadata($var) 71 | { 72 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); 73 | $this->common_metadata = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V1/DisableProcessorRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DisableProcessorRequest 17 | */ 18 | class DisableProcessorRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor resource name to be disabled. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type string $name 34 | * Required. The processor resource name to be disabled. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * Required. The processor resource name to be disabled. 44 | * 45 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 46 | * @return string 47 | */ 48 | public function getName() 49 | { 50 | return $this->name; 51 | } 52 | 53 | /** 54 | * Required. The processor resource name to be disabled. 55 | * 56 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 57 | * @param string $var 58 | * @return $this 59 | */ 60 | public function setName($var) 61 | { 62 | GPBUtil::checkString($var, True); 63 | $this->name = $var; 64 | 65 | return $this; 66 | } 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/V1/DisableProcessorResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DisableProcessorResponse 17 | */ 18 | class DisableProcessorResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * } 28 | */ 29 | public function __construct($data = NULL) { 30 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 31 | parent::__construct($data); 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/V1/Document/ChunkedDocument.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.ChunkedDocument 15 | */ 16 | class ChunkedDocument extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * List of chunks. 20 | * 21 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; 22 | */ 23 | private $chunks; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk>|\Google\Protobuf\Internal\RepeatedField $chunks 32 | * List of chunks. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * List of chunks. 42 | * 43 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getChunks() 47 | { 48 | return $this->chunks; 49 | } 50 | 51 | /** 52 | * List of chunks. 53 | * 54 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; 55 | * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setChunks($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk::class); 61 | $this->chunks = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter 15 | */ 16 | class ChunkPageFooter extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Footer in text format. 20 | * 21 | * Generated from protobuf field string text = 1; 22 | */ 23 | protected $text = ''; 24 | /** 25 | * Page span of the footer. 26 | * 27 | * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; 28 | */ 29 | protected $page_span = null; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $text 38 | * Footer in text format. 39 | * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span 40 | * Page span of the footer. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * Footer in text format. 50 | * 51 | * Generated from protobuf field string text = 1; 52 | * @return string 53 | */ 54 | public function getText() 55 | { 56 | return $this->text; 57 | } 58 | 59 | /** 60 | * Footer in text format. 61 | * 62 | * Generated from protobuf field string text = 1; 63 | * @param string $var 64 | * @return $this 65 | */ 66 | public function setText($var) 67 | { 68 | GPBUtil::checkString($var, True); 69 | $this->text = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * Page span of the footer. 76 | * 77 | * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; 78 | * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null 79 | */ 80 | public function getPageSpan() 81 | { 82 | return $this->page_span; 83 | } 84 | 85 | public function hasPageSpan() 86 | { 87 | return isset($this->page_span); 88 | } 89 | 90 | public function clearPageSpan() 91 | { 92 | unset($this->page_span); 93 | } 94 | 95 | /** 96 | * Page span of the footer. 97 | * 98 | * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; 99 | * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var 100 | * @return $this 101 | */ 102 | public function setPageSpan($var) 103 | { 104 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); 105 | $this->page_span = $var; 106 | 107 | return $this; 108 | } 109 | 110 | } 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader 15 | */ 16 | class ChunkPageHeader extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Header in text format. 20 | * 21 | * Generated from protobuf field string text = 1; 22 | */ 23 | protected $text = ''; 24 | /** 25 | * Page span of the header. 26 | * 27 | * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; 28 | */ 29 | protected $page_span = null; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $text 38 | * Header in text format. 39 | * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span 40 | * Page span of the header. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * Header in text format. 50 | * 51 | * Generated from protobuf field string text = 1; 52 | * @return string 53 | */ 54 | public function getText() 55 | { 56 | return $this->text; 57 | } 58 | 59 | /** 60 | * Header in text format. 61 | * 62 | * Generated from protobuf field string text = 1; 63 | * @param string $var 64 | * @return $this 65 | */ 66 | public function setText($var) 67 | { 68 | GPBUtil::checkString($var, True); 69 | $this->text = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * Page span of the header. 76 | * 77 | * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; 78 | * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null 79 | */ 80 | public function getPageSpan() 81 | { 82 | return $this->page_span; 83 | } 84 | 85 | public function hasPageSpan() 86 | { 87 | return isset($this->page_span); 88 | } 89 | 90 | public function clearPageSpan() 91 | { 92 | unset($this->page_span); 93 | } 94 | 95 | /** 96 | * Page span of the header. 97 | * 98 | * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; 99 | * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var 100 | * @return $this 101 | */ 102 | public function setPageSpan($var) 103 | { 104 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); 105 | $this->page_span = $var; 106 | 107 | return $this; 108 | } 109 | 110 | } 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan 15 | */ 16 | class ChunkPageSpan extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Page where chunk starts in the document. 20 | * 21 | * Generated from protobuf field int32 page_start = 1; 22 | */ 23 | protected $page_start = 0; 24 | /** 25 | * Page where chunk ends in the document. 26 | * 27 | * Generated from protobuf field int32 page_end = 2; 28 | */ 29 | protected $page_end = 0; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $page_start 38 | * Page where chunk starts in the document. 39 | * @type int $page_end 40 | * Page where chunk ends in the document. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * Page where chunk starts in the document. 50 | * 51 | * Generated from protobuf field int32 page_start = 1; 52 | * @return int 53 | */ 54 | public function getPageStart() 55 | { 56 | return $this->page_start; 57 | } 58 | 59 | /** 60 | * Page where chunk starts in the document. 61 | * 62 | * Generated from protobuf field int32 page_start = 1; 63 | * @param int $var 64 | * @return $this 65 | */ 66 | public function setPageStart($var) 67 | { 68 | GPBUtil::checkInt32($var); 69 | $this->page_start = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * Page where chunk ends in the document. 76 | * 77 | * Generated from protobuf field int32 page_end = 2; 78 | * @return int 79 | */ 80 | public function getPageEnd() 81 | { 82 | return $this->page_end; 83 | } 84 | 85 | /** 86 | * Page where chunk ends in the document. 87 | * 88 | * Generated from protobuf field int32 page_end = 2; 89 | * @param int $var 90 | * @return $this 91 | */ 92 | public function setPageEnd($var) 93 | { 94 | GPBUtil::checkInt32($var); 95 | $this->page_end = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/V1/Document/DocumentLayout.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.DocumentLayout 16 | */ 17 | class DocumentLayout extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * List of blocks in the document. 21 | * 22 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; 23 | */ 24 | private $blocks; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks 33 | * List of blocks in the document. 34 | * } 35 | */ 36 | public function __construct($data = NULL) { 37 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 38 | parent::__construct($data); 39 | } 40 | 41 | /** 42 | * List of blocks in the document. 43 | * 44 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; 45 | * @return \Google\Protobuf\Internal\RepeatedField 46 | */ 47 | public function getBlocks() 48 | { 49 | return $this->blocks; 50 | } 51 | 52 | /** 53 | * List of blocks in the document. 54 | * 55 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; 56 | * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var 57 | * @return $this 58 | */ 59 | public function setBlocks($var) 60 | { 61 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); 62 | $this->blocks = $arr; 63 | 64 | return $this; 65 | } 66 | 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry 15 | */ 16 | class LayoutListEntry extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list entry is a list of blocks. 20 | * Repeated blocks support further hierarchies and nested blocks. 21 | * 22 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; 23 | */ 24 | private $blocks; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks 33 | * A list entry is a list of blocks. 34 | * Repeated blocks support further hierarchies and nested blocks. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * A list entry is a list of blocks. 44 | * Repeated blocks support further hierarchies and nested blocks. 45 | * 46 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; 47 | * @return \Google\Protobuf\Internal\RepeatedField 48 | */ 49 | public function getBlocks() 50 | { 51 | return $this->blocks; 52 | } 53 | 54 | /** 55 | * A list entry is a list of blocks. 56 | * Repeated blocks support further hierarchies and nested blocks. 57 | * 58 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; 59 | * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var 60 | * @return $this 61 | */ 62 | public function setBlocks($var) 63 | { 64 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); 65 | $this->blocks = $arr; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan 15 | */ 16 | class LayoutPageSpan extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Page where block starts in the document. 20 | * 21 | * Generated from protobuf field int32 page_start = 1; 22 | */ 23 | protected $page_start = 0; 24 | /** 25 | * Page where block ends in the document. 26 | * 27 | * Generated from protobuf field int32 page_end = 2; 28 | */ 29 | protected $page_end = 0; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $page_start 38 | * Page where block starts in the document. 39 | * @type int $page_end 40 | * Page where block ends in the document. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * Page where block starts in the document. 50 | * 51 | * Generated from protobuf field int32 page_start = 1; 52 | * @return int 53 | */ 54 | public function getPageStart() 55 | { 56 | return $this->page_start; 57 | } 58 | 59 | /** 60 | * Page where block starts in the document. 61 | * 62 | * Generated from protobuf field int32 page_start = 1; 63 | * @param int $var 64 | * @return $this 65 | */ 66 | public function setPageStart($var) 67 | { 68 | GPBUtil::checkInt32($var); 69 | $this->page_start = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * Page where block ends in the document. 76 | * 77 | * Generated from protobuf field int32 page_end = 2; 78 | * @return int 79 | */ 80 | public function getPageEnd() 81 | { 82 | return $this->page_end; 83 | } 84 | 85 | /** 86 | * Page where block ends in the document. 87 | * 88 | * Generated from protobuf field int32 page_end = 2; 89 | * @param int $var 90 | * @return $this 91 | */ 92 | public function setPageEnd($var) 93 | { 94 | GPBUtil::checkInt32($var); 95 | $this->page_end = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow 15 | */ 16 | class LayoutTableRow extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A table row is a list of table cells. 20 | * 21 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; 22 | */ 23 | private $cells; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell>|\Google\Protobuf\Internal\RepeatedField $cells 32 | * A table row is a list of table cells. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * A table row is a list of table cells. 42 | * 43 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getCells() 47 | { 48 | return $this->cells; 49 | } 50 | 51 | /** 52 | * A table row is a list of table cells. 53 | * 54 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; 55 | * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setCells($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell::class); 61 | $this->cells = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/V1/Document/Page/DetectedLanguage.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Page.DetectedLanguage 15 | */ 16 | class DetectedLanguage extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The [BCP-47 language 20 | * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), 21 | * such as `en-US` or `sr-Latn`. 22 | * 23 | * Generated from protobuf field string language_code = 1; 24 | */ 25 | protected $language_code = ''; 26 | /** 27 | * Confidence of detected language. Range `[0, 1]`. 28 | * 29 | * Generated from protobuf field float confidence = 2; 30 | */ 31 | protected $confidence = 0.0; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type string $language_code 40 | * The [BCP-47 language 41 | * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), 42 | * such as `en-US` or `sr-Latn`. 43 | * @type float $confidence 44 | * Confidence of detected language. Range `[0, 1]`. 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * The [BCP-47 language 54 | * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), 55 | * such as `en-US` or `sr-Latn`. 56 | * 57 | * Generated from protobuf field string language_code = 1; 58 | * @return string 59 | */ 60 | public function getLanguageCode() 61 | { 62 | return $this->language_code; 63 | } 64 | 65 | /** 66 | * The [BCP-47 language 67 | * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), 68 | * such as `en-US` or `sr-Latn`. 69 | * 70 | * Generated from protobuf field string language_code = 1; 71 | * @param string $var 72 | * @return $this 73 | */ 74 | public function setLanguageCode($var) 75 | { 76 | GPBUtil::checkString($var, True); 77 | $this->language_code = $var; 78 | 79 | return $this; 80 | } 81 | 82 | /** 83 | * Confidence of detected language. Range `[0, 1]`. 84 | * 85 | * Generated from protobuf field float confidence = 2; 86 | * @return float 87 | */ 88 | public function getConfidence() 89 | { 90 | return $this->confidence; 91 | } 92 | 93 | /** 94 | * Confidence of detected language. Range `[0, 1]`. 95 | * 96 | * Generated from protobuf field float confidence = 2; 97 | * @param float $var 98 | * @return $this 99 | */ 100 | public function setConfidence($var) 101 | { 102 | GPBUtil::checkFloat($var); 103 | $this->confidence = $var; 104 | 105 | return $this; 106 | } 107 | 108 | } 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/V1/Document/Page/Dimension.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Page.Dimension 15 | */ 16 | class Dimension extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Page width. 20 | * 21 | * Generated from protobuf field float width = 1; 22 | */ 23 | protected $width = 0.0; 24 | /** 25 | * Page height. 26 | * 27 | * Generated from protobuf field float height = 2; 28 | */ 29 | protected $height = 0.0; 30 | /** 31 | * Dimension unit. 32 | * 33 | * Generated from protobuf field string unit = 3; 34 | */ 35 | protected $unit = ''; 36 | 37 | /** 38 | * Constructor. 39 | * 40 | * @param array $data { 41 | * Optional. Data for populating the Message object. 42 | * 43 | * @type float $width 44 | * Page width. 45 | * @type float $height 46 | * Page height. 47 | * @type string $unit 48 | * Dimension unit. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * Page width. 58 | * 59 | * Generated from protobuf field float width = 1; 60 | * @return float 61 | */ 62 | public function getWidth() 63 | { 64 | return $this->width; 65 | } 66 | 67 | /** 68 | * Page width. 69 | * 70 | * Generated from protobuf field float width = 1; 71 | * @param float $var 72 | * @return $this 73 | */ 74 | public function setWidth($var) 75 | { 76 | GPBUtil::checkFloat($var); 77 | $this->width = $var; 78 | 79 | return $this; 80 | } 81 | 82 | /** 83 | * Page height. 84 | * 85 | * Generated from protobuf field float height = 2; 86 | * @return float 87 | */ 88 | public function getHeight() 89 | { 90 | return $this->height; 91 | } 92 | 93 | /** 94 | * Page height. 95 | * 96 | * Generated from protobuf field float height = 2; 97 | * @param float $var 98 | * @return $this 99 | */ 100 | public function setHeight($var) 101 | { 102 | GPBUtil::checkFloat($var); 103 | $this->height = $var; 104 | 105 | return $this; 106 | } 107 | 108 | /** 109 | * Dimension unit. 110 | * 111 | * Generated from protobuf field string unit = 3; 112 | * @return string 113 | */ 114 | public function getUnit() 115 | { 116 | return $this->unit; 117 | } 118 | 119 | /** 120 | * Dimension unit. 121 | * 122 | * Generated from protobuf field string unit = 3; 123 | * @param string $var 124 | * @return $this 125 | */ 126 | public function setUnit($var) 127 | { 128 | GPBUtil::checkString($var, True); 129 | $this->unit = $var; 130 | 131 | return $this; 132 | } 133 | 134 | } 135 | 136 | 137 | -------------------------------------------------------------------------------- /src/V1/Document/Page/Layout/Orientation.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Page.Layout.Orientation 13 | */ 14 | class Orientation 15 | { 16 | /** 17 | * Unspecified orientation. 18 | * 19 | * Generated from protobuf enum ORIENTATION_UNSPECIFIED = 0; 20 | */ 21 | const ORIENTATION_UNSPECIFIED = 0; 22 | /** 23 | * Orientation is aligned with page up. 24 | * 25 | * Generated from protobuf enum PAGE_UP = 1; 26 | */ 27 | const PAGE_UP = 1; 28 | /** 29 | * Orientation is aligned with page right. 30 | * Turn the head 90 degrees clockwise from upright to read. 31 | * 32 | * Generated from protobuf enum PAGE_RIGHT = 2; 33 | */ 34 | const PAGE_RIGHT = 2; 35 | /** 36 | * Orientation is aligned with page down. 37 | * Turn the head 180 degrees from upright to read. 38 | * 39 | * Generated from protobuf enum PAGE_DOWN = 3; 40 | */ 41 | const PAGE_DOWN = 3; 42 | /** 43 | * Orientation is aligned with page left. 44 | * Turn the head 90 degrees counterclockwise from upright to read. 45 | * 46 | * Generated from protobuf enum PAGE_LEFT = 4; 47 | */ 48 | const PAGE_LEFT = 4; 49 | 50 | private static $valueToName = [ 51 | self::ORIENTATION_UNSPECIFIED => 'ORIENTATION_UNSPECIFIED', 52 | self::PAGE_UP => 'PAGE_UP', 53 | self::PAGE_RIGHT => 'PAGE_RIGHT', 54 | self::PAGE_DOWN => 'PAGE_DOWN', 55 | self::PAGE_LEFT => 'PAGE_LEFT', 56 | ]; 57 | 58 | public static function name($value) 59 | { 60 | if (!isset(self::$valueToName[$value])) { 61 | throw new UnexpectedValueException(sprintf( 62 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 63 | } 64 | return self::$valueToName[$value]; 65 | } 66 | 67 | 68 | public static function value($name) 69 | { 70 | $const = __CLASS__ . '::' . strtoupper($name); 71 | if (!defined($const)) { 72 | throw new UnexpectedValueException(sprintf( 73 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 74 | } 75 | return constant($const); 76 | } 77 | } 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/V1/Document/Page/Table/TableRow.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Page.Table.TableRow 15 | */ 16 | class TableRow extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Cells that make up this row. 20 | * 21 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; 22 | */ 23 | private $cells; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell>|\Google\Protobuf\Internal\RepeatedField $cells 32 | * Cells that make up this row. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Cells that make up this row. 42 | * 43 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getCells() 47 | { 48 | return $this->cells; 49 | } 50 | 51 | /** 52 | * Cells that make up this row. 53 | * 54 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; 55 | * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setCells($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell::class); 61 | $this->cells = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/V1/Document/Page/Token/DetectedBreak.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Page.Token.DetectedBreak 16 | */ 17 | class DetectedBreak extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * Detected break type. 21 | * 22 | * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; 23 | */ 24 | protected $type = 0; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type int $type 33 | * Detected break type. 34 | * } 35 | */ 36 | public function __construct($data = NULL) { 37 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 38 | parent::__construct($data); 39 | } 40 | 41 | /** 42 | * Detected break type. 43 | * 44 | * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; 45 | * @return int 46 | */ 47 | public function getType() 48 | { 49 | return $this->type; 50 | } 51 | 52 | /** 53 | * Detected break type. 54 | * 55 | * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; 56 | * @param int $var 57 | * @return $this 58 | */ 59 | public function setType($var) 60 | { 61 | GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak\Type::class); 62 | $this->type = $var; 63 | 64 | return $this; 65 | } 66 | 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/V1/Document/Page/Token/DetectedBreak/Type.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type 13 | */ 14 | class Type 15 | { 16 | /** 17 | * Unspecified break type. 18 | * 19 | * Generated from protobuf enum TYPE_UNSPECIFIED = 0; 20 | */ 21 | const TYPE_UNSPECIFIED = 0; 22 | /** 23 | * A single whitespace. 24 | * 25 | * Generated from protobuf enum SPACE = 1; 26 | */ 27 | const SPACE = 1; 28 | /** 29 | * A wider whitespace. 30 | * 31 | * Generated from protobuf enum WIDE_SPACE = 2; 32 | */ 33 | const WIDE_SPACE = 2; 34 | /** 35 | * A hyphen that indicates that a token has been split across lines. 36 | * 37 | * Generated from protobuf enum HYPHEN = 3; 38 | */ 39 | const HYPHEN = 3; 40 | 41 | private static $valueToName = [ 42 | self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', 43 | self::SPACE => 'SPACE', 44 | self::WIDE_SPACE => 'WIDE_SPACE', 45 | self::HYPHEN => 'HYPHEN', 46 | ]; 47 | 48 | public static function name($value) 49 | { 50 | if (!isset(self::$valueToName[$value])) { 51 | throw new UnexpectedValueException(sprintf( 52 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 53 | } 54 | return self::$valueToName[$value]; 55 | } 56 | 57 | 58 | public static function value($name) 59 | { 60 | $const = __CLASS__ . '::' . strtoupper($name); 61 | if (!defined($const)) { 62 | throw new UnexpectedValueException(sprintf( 63 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 64 | } 65 | return constant($const); 66 | } 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/V1/Document/PageAnchor.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.PageAnchor 18 | */ 19 | class PageAnchor extends \Google\Protobuf\Internal\Message 20 | { 21 | /** 22 | * One or more references to visual page elements 23 | * 24 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; 25 | */ 26 | private $page_refs; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param array $data { 32 | * Optional. Data for populating the Message object. 33 | * 34 | * @type array<\Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef>|\Google\Protobuf\Internal\RepeatedField $page_refs 35 | * One or more references to visual page elements 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * One or more references to visual page elements 45 | * 46 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; 47 | * @return \Google\Protobuf\Internal\RepeatedField 48 | */ 49 | public function getPageRefs() 50 | { 51 | return $this->page_refs; 52 | } 53 | 54 | /** 55 | * One or more references to visual page elements 56 | * 57 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; 58 | * @param array<\Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef>|\Google\Protobuf\Internal\RepeatedField $var 59 | * @return $this 60 | */ 61 | public function setPageRefs($var) 62 | { 63 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef::class); 64 | $this->page_refs = $arr; 65 | 66 | return $this; 67 | } 68 | 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/V1/Document/PageAnchor/PageRef/LayoutType.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType 13 | */ 14 | class LayoutType 15 | { 16 | /** 17 | * Layout Unspecified. 18 | * 19 | * Generated from protobuf enum LAYOUT_TYPE_UNSPECIFIED = 0; 20 | */ 21 | const LAYOUT_TYPE_UNSPECIFIED = 0; 22 | /** 23 | * References a 24 | * [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] 25 | * element. 26 | * 27 | * Generated from protobuf enum BLOCK = 1; 28 | */ 29 | const BLOCK = 1; 30 | /** 31 | * References a 32 | * [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] 33 | * element. 34 | * 35 | * Generated from protobuf enum PARAGRAPH = 2; 36 | */ 37 | const PARAGRAPH = 2; 38 | /** 39 | * References a 40 | * [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. 41 | * 42 | * Generated from protobuf enum LINE = 3; 43 | */ 44 | const LINE = 3; 45 | /** 46 | * References a 47 | * [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] 48 | * element. 49 | * 50 | * Generated from protobuf enum TOKEN = 4; 51 | */ 52 | const TOKEN = 4; 53 | /** 54 | * References a 55 | * [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] 56 | * element. 57 | * 58 | * Generated from protobuf enum VISUAL_ELEMENT = 5; 59 | */ 60 | const VISUAL_ELEMENT = 5; 61 | /** 62 | * Refrrences a 63 | * [Page.tables][google.cloud.documentai.v1.Document.Page.tables] 64 | * element. 65 | * 66 | * Generated from protobuf enum TABLE = 6; 67 | */ 68 | const TABLE = 6; 69 | /** 70 | * References a 71 | * [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] 72 | * element. 73 | * 74 | * Generated from protobuf enum FORM_FIELD = 7; 75 | */ 76 | const FORM_FIELD = 7; 77 | 78 | private static $valueToName = [ 79 | self::LAYOUT_TYPE_UNSPECIFIED => 'LAYOUT_TYPE_UNSPECIFIED', 80 | self::BLOCK => 'BLOCK', 81 | self::PARAGRAPH => 'PARAGRAPH', 82 | self::LINE => 'LINE', 83 | self::TOKEN => 'TOKEN', 84 | self::VISUAL_ELEMENT => 'VISUAL_ELEMENT', 85 | self::TABLE => 'TABLE', 86 | self::FORM_FIELD => 'FORM_FIELD', 87 | ]; 88 | 89 | public static function name($value) 90 | { 91 | if (!isset(self::$valueToName[$value])) { 92 | throw new UnexpectedValueException(sprintf( 93 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 94 | } 95 | return self::$valueToName[$value]; 96 | } 97 | 98 | 99 | public static function value($name) 100 | { 101 | $const = __CLASS__ . '::' . strtoupper($name); 102 | if (!defined($const)) { 103 | throw new UnexpectedValueException(sprintf( 104 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 105 | } 106 | return constant($const); 107 | } 108 | } 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/V1/Document/Provenance/OperationType.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Provenance.OperationType 13 | */ 14 | class OperationType 15 | { 16 | /** 17 | * Operation type unspecified. If no operation is specified a provenance 18 | * entry is simply used to match against a `parent`. 19 | * 20 | * Generated from protobuf enum OPERATION_TYPE_UNSPECIFIED = 0; 21 | */ 22 | const OPERATION_TYPE_UNSPECIFIED = 0; 23 | /** 24 | * Add an element. 25 | * 26 | * Generated from protobuf enum ADD = 1; 27 | */ 28 | const ADD = 1; 29 | /** 30 | * Remove an element identified by `parent`. 31 | * 32 | * Generated from protobuf enum REMOVE = 2; 33 | */ 34 | const REMOVE = 2; 35 | /** 36 | * Updates any fields within the given provenance scope of the message. It 37 | * overwrites the fields rather than replacing them. Use this when you 38 | * want to update a field value of an entity without also updating all the 39 | * child properties. 40 | * 41 | * Generated from protobuf enum UPDATE = 7; 42 | */ 43 | const UPDATE = 7; 44 | /** 45 | * Currently unused. Replace an element identified by `parent`. 46 | * 47 | * Generated from protobuf enum REPLACE = 3; 48 | */ 49 | const REPLACE = 3; 50 | /** 51 | * Deprecated. Request human review for the element identified by 52 | * `parent`. 53 | * 54 | * Generated from protobuf enum EVAL_REQUESTED = 4 [deprecated = true]; 55 | */ 56 | const EVAL_REQUESTED = 4; 57 | /** 58 | * Deprecated. Element is reviewed and approved at human review, 59 | * confidence will be set to 1.0. 60 | * 61 | * Generated from protobuf enum EVAL_APPROVED = 5 [deprecated = true]; 62 | */ 63 | const EVAL_APPROVED = 5; 64 | /** 65 | * Deprecated. Element is skipped in the validation process. 66 | * 67 | * Generated from protobuf enum EVAL_SKIPPED = 6 [deprecated = true]; 68 | */ 69 | const EVAL_SKIPPED = 6; 70 | 71 | private static $valueToName = [ 72 | self::OPERATION_TYPE_UNSPECIFIED => 'OPERATION_TYPE_UNSPECIFIED', 73 | self::ADD => 'ADD', 74 | self::REMOVE => 'REMOVE', 75 | self::UPDATE => 'UPDATE', 76 | self::REPLACE => 'REPLACE', 77 | self::EVAL_REQUESTED => 'EVAL_REQUESTED', 78 | self::EVAL_APPROVED => 'EVAL_APPROVED', 79 | self::EVAL_SKIPPED => 'EVAL_SKIPPED', 80 | ]; 81 | 82 | public static function name($value) 83 | { 84 | if (!isset(self::$valueToName[$value])) { 85 | throw new UnexpectedValueException(sprintf( 86 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 87 | } 88 | return self::$valueToName[$value]; 89 | } 90 | 91 | 92 | public static function value($name) 93 | { 94 | $const = __CLASS__ . '::' . strtoupper($name); 95 | if (!defined($const)) { 96 | throw new UnexpectedValueException(sprintf( 97 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 98 | } 99 | return constant($const); 100 | } 101 | } 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/V1/Document/Revision/HumanReview.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Revision.HumanReview 15 | */ 16 | class HumanReview extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Human review state. e.g. `requested`, `succeeded`, `rejected`. 20 | * 21 | * Generated from protobuf field string state = 1; 22 | */ 23 | protected $state = ''; 24 | /** 25 | * A message providing more details about the current state of processing. 26 | * For example, the rejection reason when the state is `rejected`. 27 | * 28 | * Generated from protobuf field string state_message = 2; 29 | */ 30 | protected $state_message = ''; 31 | 32 | /** 33 | * Constructor. 34 | * 35 | * @param array $data { 36 | * Optional. Data for populating the Message object. 37 | * 38 | * @type string $state 39 | * Human review state. e.g. `requested`, `succeeded`, `rejected`. 40 | * @type string $state_message 41 | * A message providing more details about the current state of processing. 42 | * For example, the rejection reason when the state is `rejected`. 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * Human review state. e.g. `requested`, `succeeded`, `rejected`. 52 | * 53 | * Generated from protobuf field string state = 1; 54 | * @return string 55 | */ 56 | public function getState() 57 | { 58 | return $this->state; 59 | } 60 | 61 | /** 62 | * Human review state. e.g. `requested`, `succeeded`, `rejected`. 63 | * 64 | * Generated from protobuf field string state = 1; 65 | * @param string $var 66 | * @return $this 67 | */ 68 | public function setState($var) 69 | { 70 | GPBUtil::checkString($var, True); 71 | $this->state = $var; 72 | 73 | return $this; 74 | } 75 | 76 | /** 77 | * A message providing more details about the current state of processing. 78 | * For example, the rejection reason when the state is `rejected`. 79 | * 80 | * Generated from protobuf field string state_message = 2; 81 | * @return string 82 | */ 83 | public function getStateMessage() 84 | { 85 | return $this->state_message; 86 | } 87 | 88 | /** 89 | * A message providing more details about the current state of processing. 90 | * For example, the rejection reason when the state is `rejected`. 91 | * 92 | * Generated from protobuf field string state_message = 2; 93 | * @param string $var 94 | * @return $this 95 | */ 96 | public function setStateMessage($var) 97 | { 98 | GPBUtil::checkString($var, True); 99 | $this->state_message = $var; 100 | 101 | return $this; 102 | } 103 | 104 | } 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/V1/Document/Style/FontSize.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Document.Style.FontSize 15 | */ 16 | class FontSize extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Font size for the text. 20 | * 21 | * Generated from protobuf field float size = 1; 22 | */ 23 | protected $size = 0.0; 24 | /** 25 | * Unit for the font size. Follows CSS naming (such as `in`, `px`, and 26 | * `pt`). 27 | * 28 | * Generated from protobuf field string unit = 2; 29 | */ 30 | protected $unit = ''; 31 | 32 | /** 33 | * Constructor. 34 | * 35 | * @param array $data { 36 | * Optional. Data for populating the Message object. 37 | * 38 | * @type float $size 39 | * Font size for the text. 40 | * @type string $unit 41 | * Unit for the font size. Follows CSS naming (such as `in`, `px`, and 42 | * `pt`). 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * Font size for the text. 52 | * 53 | * Generated from protobuf field float size = 1; 54 | * @return float 55 | */ 56 | public function getSize() 57 | { 58 | return $this->size; 59 | } 60 | 61 | /** 62 | * Font size for the text. 63 | * 64 | * Generated from protobuf field float size = 1; 65 | * @param float $var 66 | * @return $this 67 | */ 68 | public function setSize($var) 69 | { 70 | GPBUtil::checkFloat($var); 71 | $this->size = $var; 72 | 73 | return $this; 74 | } 75 | 76 | /** 77 | * Unit for the font size. Follows CSS naming (such as `in`, `px`, and 78 | * `pt`). 79 | * 80 | * Generated from protobuf field string unit = 2; 81 | * @return string 82 | */ 83 | public function getUnit() 84 | { 85 | return $this->unit; 86 | } 87 | 88 | /** 89 | * Unit for the font size. Follows CSS naming (such as `in`, `px`, and 90 | * `pt`). 91 | * 92 | * Generated from protobuf field string unit = 2; 93 | * @param string $var 94 | * @return $this 95 | */ 96 | public function setUnit($var) 97 | { 98 | GPBUtil::checkString($var, True); 99 | $this->unit = $var; 100 | 101 | return $this; 102 | } 103 | 104 | } 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/V1/DocumentOutputConfig.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DocumentOutputConfig 16 | */ 17 | class DocumentOutputConfig extends \Google\Protobuf\Internal\Message 18 | { 19 | protected $destination; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig $gcs_output_config 28 | * Output config to write the results to Cloud Storage. 29 | * } 30 | */ 31 | public function __construct($data = NULL) { 32 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); 33 | parent::__construct($data); 34 | } 35 | 36 | /** 37 | * Output config to write the results to Cloud Storage. 38 | * 39 | * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig gcs_output_config = 1; 40 | * @return \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig|null 41 | */ 42 | public function getGcsOutputConfig() 43 | { 44 | return $this->readOneof(1); 45 | } 46 | 47 | public function hasGcsOutputConfig() 48 | { 49 | return $this->hasOneof(1); 50 | } 51 | 52 | /** 53 | * Output config to write the results to Cloud Storage. 54 | * 55 | * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig gcs_output_config = 1; 56 | * @param \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig $var 57 | * @return $this 58 | */ 59 | public function setGcsOutputConfig($var) 60 | { 61 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig::class); 62 | $this->writeOneof(1, $var); 63 | 64 | return $this; 65 | } 66 | 67 | /** 68 | * @return string 69 | */ 70 | public function getDestination() 71 | { 72 | return $this->whichOneof("destination"); 73 | } 74 | 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig 15 | */ 16 | class ShardingConfig extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The number of pages per shard. 20 | * 21 | * Generated from protobuf field int32 pages_per_shard = 1; 22 | */ 23 | protected $pages_per_shard = 0; 24 | /** 25 | * The number of overlapping pages between consecutive shards. 26 | * 27 | * Generated from protobuf field int32 pages_overlap = 2; 28 | */ 29 | protected $pages_overlap = 0; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $pages_per_shard 38 | * The number of pages per shard. 39 | * @type int $pages_overlap 40 | * The number of overlapping pages between consecutive shards. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The number of pages per shard. 50 | * 51 | * Generated from protobuf field int32 pages_per_shard = 1; 52 | * @return int 53 | */ 54 | public function getPagesPerShard() 55 | { 56 | return $this->pages_per_shard; 57 | } 58 | 59 | /** 60 | * The number of pages per shard. 61 | * 62 | * Generated from protobuf field int32 pages_per_shard = 1; 63 | * @param int $var 64 | * @return $this 65 | */ 66 | public function setPagesPerShard($var) 67 | { 68 | GPBUtil::checkInt32($var); 69 | $this->pages_per_shard = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * The number of overlapping pages between consecutive shards. 76 | * 77 | * Generated from protobuf field int32 pages_overlap = 2; 78 | * @return int 79 | */ 80 | public function getPagesOverlap() 81 | { 82 | return $this->pages_overlap; 83 | } 84 | 85 | /** 86 | * The number of overlapping pages between consecutive shards. 87 | * 88 | * Generated from protobuf field int32 pages_overlap = 2; 89 | * @param int $var 90 | * @return $this 91 | */ 92 | public function setPagesOverlap($var) 93 | { 94 | GPBUtil::checkInt32($var); 95 | $this->pages_overlap = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/V1/DocumentSchema/EntityType/EnumValues.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues 15 | */ 16 | class EnumValues extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The individual values that this enum values type can include. 20 | * 21 | * Generated from protobuf field repeated string values = 1; 22 | */ 23 | private $values; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array|\Google\Protobuf\Internal\RepeatedField $values 32 | * The individual values that this enum values type can include. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * The individual values that this enum values type can include. 42 | * 43 | * Generated from protobuf field repeated string values = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getValues() 47 | { 48 | return $this->values; 49 | } 50 | 51 | /** 52 | * The individual values that this enum values type can include. 53 | * 54 | * Generated from protobuf field repeated string values = 1; 55 | * @param array|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setValues($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 61 | $this->values = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/V1/DocumentSchema/EntityType/Property/OccurrenceType.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType 21 | */ 22 | class OccurrenceType 23 | { 24 | /** 25 | * Unspecified occurrence type. 26 | * 27 | * Generated from protobuf enum OCCURRENCE_TYPE_UNSPECIFIED = 0; 28 | */ 29 | const OCCURRENCE_TYPE_UNSPECIFIED = 0; 30 | /** 31 | * There will be zero or one instance of this entity type. The same 32 | * entity instance may be mentioned multiple times. 33 | * 34 | * Generated from protobuf enum OPTIONAL_ONCE = 1; 35 | */ 36 | const OPTIONAL_ONCE = 1; 37 | /** 38 | * The entity type will appear zero or multiple times. 39 | * 40 | * Generated from protobuf enum OPTIONAL_MULTIPLE = 2; 41 | */ 42 | const OPTIONAL_MULTIPLE = 2; 43 | /** 44 | * The entity type will only appear exactly once. The same 45 | * entity instance may be mentioned multiple times. 46 | * 47 | * Generated from protobuf enum REQUIRED_ONCE = 3; 48 | */ 49 | const REQUIRED_ONCE = 3; 50 | /** 51 | * The entity type will appear once or more times. 52 | * 53 | * Generated from protobuf enum REQUIRED_MULTIPLE = 4; 54 | */ 55 | const REQUIRED_MULTIPLE = 4; 56 | 57 | private static $valueToName = [ 58 | self::OCCURRENCE_TYPE_UNSPECIFIED => 'OCCURRENCE_TYPE_UNSPECIFIED', 59 | self::OPTIONAL_ONCE => 'OPTIONAL_ONCE', 60 | self::OPTIONAL_MULTIPLE => 'OPTIONAL_MULTIPLE', 61 | self::REQUIRED_ONCE => 'REQUIRED_ONCE', 62 | self::REQUIRED_MULTIPLE => 'REQUIRED_MULTIPLE', 63 | ]; 64 | 65 | public static function name($value) 66 | { 67 | if (!isset(self::$valueToName[$value])) { 68 | throw new UnexpectedValueException(sprintf( 69 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 70 | } 71 | return self::$valueToName[$value]; 72 | } 73 | 74 | 75 | public static function value($name) 76 | { 77 | $const = __CLASS__ . '::' . strtoupper($name); 78 | if (!defined($const)) { 79 | throw new UnexpectedValueException(sprintf( 80 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 81 | } 82 | return constant($const); 83 | } 84 | } 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/V1/EnableProcessorMetadata.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.EnableProcessorMetadata 17 | */ 18 | class EnableProcessorMetadata extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The basic metadata of the long-running operation. 22 | * 23 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 24 | */ 25 | protected $common_metadata = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata 34 | * The basic metadata of the long-running operation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The basic metadata of the long-running operation. 44 | * 45 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 46 | * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null 47 | */ 48 | public function getCommonMetadata() 49 | { 50 | return $this->common_metadata; 51 | } 52 | 53 | public function hasCommonMetadata() 54 | { 55 | return isset($this->common_metadata); 56 | } 57 | 58 | public function clearCommonMetadata() 59 | { 60 | unset($this->common_metadata); 61 | } 62 | 63 | /** 64 | * The basic metadata of the long-running operation. 65 | * 66 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; 67 | * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var 68 | * @return $this 69 | */ 70 | public function setCommonMetadata($var) 71 | { 72 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); 73 | $this->common_metadata = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V1/EnableProcessorRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.EnableProcessorRequest 17 | */ 18 | class EnableProcessorRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor resource name to be enabled. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type string $name 34 | * Required. The processor resource name to be enabled. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * Required. The processor resource name to be enabled. 44 | * 45 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 46 | * @return string 47 | */ 48 | public function getName() 49 | { 50 | return $this->name; 51 | } 52 | 53 | /** 54 | * Required. The processor resource name to be enabled. 55 | * 56 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 57 | * @param string $var 58 | * @return $this 59 | */ 60 | public function setName($var) 61 | { 62 | GPBUtil::checkString($var, True); 63 | $this->name = $var; 64 | 65 | return $this; 66 | } 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/V1/EnableProcessorResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.EnableProcessorResponse 17 | */ 18 | class EnableProcessorResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * } 28 | */ 29 | public function __construct($data = NULL) { 30 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 31 | parent::__construct($data); 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/V1/EvaluateProcessorVersionMetadata.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.EvaluateProcessorVersionMetadata 17 | */ 18 | class EvaluateProcessorVersionMetadata extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The basic metadata of the long-running operation. 22 | * 23 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 24 | */ 25 | protected $common_metadata = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata 34 | * The basic metadata of the long-running operation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The basic metadata of the long-running operation. 44 | * 45 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 46 | * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null 47 | */ 48 | public function getCommonMetadata() 49 | { 50 | return $this->common_metadata; 51 | } 52 | 53 | public function hasCommonMetadata() 54 | { 55 | return isset($this->common_metadata); 56 | } 57 | 58 | public function clearCommonMetadata() 59 | { 60 | unset($this->common_metadata); 61 | } 62 | 63 | /** 64 | * The basic metadata of the long-running operation. 65 | * 66 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 67 | * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var 68 | * @return $this 69 | */ 70 | public function setCommonMetadata($var) 71 | { 72 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); 73 | $this->common_metadata = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V1/EvaluateProcessorVersionResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.EvaluateProcessorVersionResponse 17 | */ 18 | class EvaluateProcessorVersionResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The resource name of the created evaluation. 22 | * 23 | * Generated from protobuf field string evaluation = 2; 24 | */ 25 | protected $evaluation = ''; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type string $evaluation 34 | * The resource name of the created evaluation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The resource name of the created evaluation. 44 | * 45 | * Generated from protobuf field string evaluation = 2; 46 | * @return string 47 | */ 48 | public function getEvaluation() 49 | { 50 | return $this->evaluation; 51 | } 52 | 53 | /** 54 | * The resource name of the created evaluation. 55 | * 56 | * Generated from protobuf field string evaluation = 2; 57 | * @param string $var 58 | * @return $this 59 | */ 60 | public function setEvaluation($var) 61 | { 62 | GPBUtil::checkString($var, True); 63 | $this->evaluation = $var; 64 | 65 | return $this; 66 | } 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/V1/Evaluation/ConfidenceLevelMetrics.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics 15 | */ 16 | class ConfidenceLevelMetrics extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The confidence level. 20 | * 21 | * Generated from protobuf field float confidence_level = 1; 22 | */ 23 | protected $confidence_level = 0.0; 24 | /** 25 | * The metrics at the specific confidence level. 26 | * 27 | * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; 28 | */ 29 | protected $metrics = null; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type float $confidence_level 38 | * The confidence level. 39 | * @type \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $metrics 40 | * The metrics at the specific confidence level. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The confidence level. 50 | * 51 | * Generated from protobuf field float confidence_level = 1; 52 | * @return float 53 | */ 54 | public function getConfidenceLevel() 55 | { 56 | return $this->confidence_level; 57 | } 58 | 59 | /** 60 | * The confidence level. 61 | * 62 | * Generated from protobuf field float confidence_level = 1; 63 | * @param float $var 64 | * @return $this 65 | */ 66 | public function setConfidenceLevel($var) 67 | { 68 | GPBUtil::checkFloat($var); 69 | $this->confidence_level = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * The metrics at the specific confidence level. 76 | * 77 | * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; 78 | * @return \Google\Cloud\DocumentAI\V1\Evaluation\Metrics|null 79 | */ 80 | public function getMetrics() 81 | { 82 | return $this->metrics; 83 | } 84 | 85 | public function hasMetrics() 86 | { 87 | return isset($this->metrics); 88 | } 89 | 90 | public function clearMetrics() 91 | { 92 | unset($this->metrics); 93 | } 94 | 95 | /** 96 | * The metrics at the specific confidence level. 97 | * 98 | * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; 99 | * @param \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $var 100 | * @return $this 101 | */ 102 | public function setMetrics($var) 103 | { 104 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Metrics::class); 105 | $this->metrics = $var; 106 | 107 | return $this; 108 | } 109 | 110 | } 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType 13 | */ 14 | class MetricsType 15 | { 16 | /** 17 | * The metrics type is unspecified. By default, metrics without a 18 | * particular specification are for leaf entity types (i.e., top-level 19 | * entity types without child types, or child types which are not 20 | * parent types themselves). 21 | * 22 | * Generated from protobuf enum METRICS_TYPE_UNSPECIFIED = 0; 23 | */ 24 | const METRICS_TYPE_UNSPECIFIED = 0; 25 | /** 26 | * Indicates whether metrics for this particular label type represent an 27 | * aggregate of metrics for other types instead of being based on actual 28 | * TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) 29 | * entity types are an aggregate of metrics for their children. 30 | * 31 | * Generated from protobuf enum AGGREGATE = 1; 32 | */ 33 | const AGGREGATE = 1; 34 | 35 | private static $valueToName = [ 36 | self::METRICS_TYPE_UNSPECIFIED => 'METRICS_TYPE_UNSPECIFIED', 37 | self::AGGREGATE => 'AGGREGATE', 38 | ]; 39 | 40 | public static function name($value) 41 | { 42 | if (!isset(self::$valueToName[$value])) { 43 | throw new UnexpectedValueException(sprintf( 44 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 45 | } 46 | return self::$valueToName[$value]; 47 | } 48 | 49 | 50 | public static function value($name) 51 | { 52 | $const = __CLASS__ . '::' . strtoupper($name); 53 | if (!defined($const)) { 54 | throw new UnexpectedValueException(sprintf( 55 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 56 | } 57 | return constant($const); 58 | } 59 | } 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/V1/FetchProcessorTypesRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.FetchProcessorTypesRequest 18 | */ 19 | class FetchProcessorTypesRequest extends \Google\Protobuf\Internal\Message 20 | { 21 | /** 22 | * Required. The location of processor types to list. 23 | * Format: `projects/{project}/locations/{location}`. 24 | * 25 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 26 | */ 27 | protected $parent = ''; 28 | 29 | /** 30 | * @param string $parent Required. The location of processor types to list. 31 | * Format: `projects/{project}/locations/{location}`. Please see 32 | * {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. 33 | * 34 | * @return \Google\Cloud\DocumentAI\V1\FetchProcessorTypesRequest 35 | * 36 | * @experimental 37 | */ 38 | public static function build(string $parent): self 39 | { 40 | return (new self()) 41 | ->setParent($parent); 42 | } 43 | 44 | /** 45 | * Constructor. 46 | * 47 | * @param array $data { 48 | * Optional. Data for populating the Message object. 49 | * 50 | * @type string $parent 51 | * Required. The location of processor types to list. 52 | * Format: `projects/{project}/locations/{location}`. 53 | * } 54 | */ 55 | public function __construct($data = NULL) { 56 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 57 | parent::__construct($data); 58 | } 59 | 60 | /** 61 | * Required. The location of processor types to list. 62 | * Format: `projects/{project}/locations/{location}`. 63 | * 64 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 65 | * @return string 66 | */ 67 | public function getParent() 68 | { 69 | return $this->parent; 70 | } 71 | 72 | /** 73 | * Required. The location of processor types to list. 74 | * Format: `projects/{project}/locations/{location}`. 75 | * 76 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 77 | * @param string $var 78 | * @return $this 79 | */ 80 | public function setParent($var) 81 | { 82 | GPBUtil::checkString($var, True); 83 | $this->parent = $var; 84 | 85 | return $this; 86 | } 87 | 88 | } 89 | 90 | -------------------------------------------------------------------------------- /src/V1/FetchProcessorTypesResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.FetchProcessorTypesResponse 17 | */ 18 | class FetchProcessorTypesResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The list of processor types. 22 | * 23 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; 24 | */ 25 | private $processor_types; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $processor_types 34 | * The list of processor types. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The list of processor types. 44 | * 45 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; 46 | * @return \Google\Protobuf\Internal\RepeatedField 47 | */ 48 | public function getProcessorTypes() 49 | { 50 | return $this->processor_types; 51 | } 52 | 53 | /** 54 | * The list of processor types. 55 | * 56 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; 57 | * @param array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $var 58 | * @return $this 59 | */ 60 | public function setProcessorTypes($var) 61 | { 62 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorType::class); 63 | $this->processor_types = $arr; 64 | 65 | return $this; 66 | } 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/V1/GcsDocument.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.GcsDocument 15 | */ 16 | class GcsDocument extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The Cloud Storage object uri. 20 | * 21 | * Generated from protobuf field string gcs_uri = 1; 22 | */ 23 | protected $gcs_uri = ''; 24 | /** 25 | * An IANA MIME type (RFC6838) of the content. 26 | * 27 | * Generated from protobuf field string mime_type = 2; 28 | */ 29 | protected $mime_type = ''; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $gcs_uri 38 | * The Cloud Storage object uri. 39 | * @type string $mime_type 40 | * An IANA MIME type (RFC6838) of the content. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The Cloud Storage object uri. 50 | * 51 | * Generated from protobuf field string gcs_uri = 1; 52 | * @return string 53 | */ 54 | public function getGcsUri() 55 | { 56 | return $this->gcs_uri; 57 | } 58 | 59 | /** 60 | * The Cloud Storage object uri. 61 | * 62 | * Generated from protobuf field string gcs_uri = 1; 63 | * @param string $var 64 | * @return $this 65 | */ 66 | public function setGcsUri($var) 67 | { 68 | GPBUtil::checkString($var, True); 69 | $this->gcs_uri = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * An IANA MIME type (RFC6838) of the content. 76 | * 77 | * Generated from protobuf field string mime_type = 2; 78 | * @return string 79 | */ 80 | public function getMimeType() 81 | { 82 | return $this->mime_type; 83 | } 84 | 85 | /** 86 | * An IANA MIME type (RFC6838) of the content. 87 | * 88 | * Generated from protobuf field string mime_type = 2; 89 | * @param string $var 90 | * @return $this 91 | */ 92 | public function setMimeType($var) 93 | { 94 | GPBUtil::checkString($var, True); 95 | $this->mime_type = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | -------------------------------------------------------------------------------- /src/V1/GcsDocuments.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.GcsDocuments 15 | */ 16 | class GcsDocuments extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The list of documents. 20 | * 21 | * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; 22 | */ 23 | private $documents; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Cloud\DocumentAI\V1\GcsDocument>|\Google\Protobuf\Internal\RepeatedField $documents 32 | * The list of documents. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * The list of documents. 42 | * 43 | * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getDocuments() 47 | { 48 | return $this->documents; 49 | } 50 | 51 | /** 52 | * The list of documents. 53 | * 54 | * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; 55 | * @param array<\Google\Cloud\DocumentAI\V1\GcsDocument>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setDocuments($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\GcsDocument::class); 61 | $this->documents = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1/GcsPrefix.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.GcsPrefix 15 | */ 16 | class GcsPrefix extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The URI prefix. 20 | * 21 | * Generated from protobuf field string gcs_uri_prefix = 1; 22 | */ 23 | protected $gcs_uri_prefix = ''; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type string $gcs_uri_prefix 32 | * The URI prefix. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * The URI prefix. 42 | * 43 | * Generated from protobuf field string gcs_uri_prefix = 1; 44 | * @return string 45 | */ 46 | public function getGcsUriPrefix() 47 | { 48 | return $this->gcs_uri_prefix; 49 | } 50 | 51 | /** 52 | * The URI prefix. 53 | * 54 | * Generated from protobuf field string gcs_uri_prefix = 1; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setGcsUriPrefix($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->gcs_uri_prefix = $var; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1/GetEvaluationRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.GetEvaluationRequest 15 | */ 16 | class GetEvaluationRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the 20 | * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. 21 | * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The resource name of the 29 | * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. 30 | * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` 31 | * Please see {@see DocumentProcessorServiceClient::evaluationName()} for help formatting this field. 32 | * 33 | * @return \Google\Cloud\DocumentAI\V1\GetEvaluationRequest 34 | * 35 | * @experimental 36 | */ 37 | public static function build(string $name): self 38 | { 39 | return (new self()) 40 | ->setName($name); 41 | } 42 | 43 | /** 44 | * Constructor. 45 | * 46 | * @param array $data { 47 | * Optional. Data for populating the Message object. 48 | * 49 | * @type string $name 50 | * Required. The resource name of the 51 | * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. 52 | * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` 53 | * } 54 | */ 55 | public function __construct($data = NULL) { 56 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 57 | parent::__construct($data); 58 | } 59 | 60 | /** 61 | * Required. The resource name of the 62 | * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. 63 | * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` 64 | * 65 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 66 | * @return string 67 | */ 68 | public function getName() 69 | { 70 | return $this->name; 71 | } 72 | 73 | /** 74 | * Required. The resource name of the 75 | * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. 76 | * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` 77 | * 78 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 79 | * @param string $var 80 | * @return $this 81 | */ 82 | public function setName($var) 83 | { 84 | GPBUtil::checkString($var, True); 85 | $this->name = $var; 86 | 87 | return $this; 88 | } 89 | 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/V1/GetProcessorRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.GetProcessorRequest 17 | */ 18 | class GetProcessorRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor resource name. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The processor resource name. Please see 29 | * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. 30 | * 31 | * @return \Google\Cloud\DocumentAI\V1\GetProcessorRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The processor resource name. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * Required. The processor resource name. 58 | * 59 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 60 | * @return string 61 | */ 62 | public function getName() 63 | { 64 | return $this->name; 65 | } 66 | 67 | /** 68 | * Required. The processor resource name. 69 | * 70 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 71 | * @param string $var 72 | * @return $this 73 | */ 74 | public function setName($var) 75 | { 76 | GPBUtil::checkString($var, True); 77 | $this->name = $var; 78 | 79 | return $this; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/V1/GetProcessorTypeRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.GetProcessorTypeRequest 17 | */ 18 | class GetProcessorTypeRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor type resource name. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The processor type resource name. Please see 29 | * {@see DocumentProcessorServiceClient::processorTypeName()} for help formatting this field. 30 | * 31 | * @return \Google\Cloud\DocumentAI\V1\GetProcessorTypeRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The processor type resource name. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * Required. The processor type resource name. 58 | * 59 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 60 | * @return string 61 | */ 62 | public function getName() 63 | { 64 | return $this->name; 65 | } 66 | 67 | /** 68 | * Required. The processor type resource name. 69 | * 70 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 71 | * @param string $var 72 | * @return $this 73 | */ 74 | public function setName($var) 75 | { 76 | GPBUtil::checkString($var, True); 77 | $this->name = $var; 78 | 79 | return $this; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/V1/GetProcessorVersionRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.GetProcessorVersionRequest 17 | */ 18 | class GetProcessorVersionRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor resource name. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The processor resource name. Please see 29 | * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. 30 | * 31 | * @return \Google\Cloud\DocumentAI\V1\GetProcessorVersionRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The processor resource name. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * Required. The processor resource name. 58 | * 59 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 60 | * @return string 61 | */ 62 | public function getName() 63 | { 64 | return $this->name; 65 | } 66 | 67 | /** 68 | * Required. The processor resource name. 69 | * 70 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 71 | * @param string $var 72 | * @return $this 73 | */ 74 | public function setName($var) 75 | { 76 | GPBUtil::checkString($var, True); 77 | $this->name = $var; 78 | 79 | return $this; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/V1/HumanReviewStatus/State.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.HumanReviewStatus.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * Human review state is unspecified. Most likely due to an internal error. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * Human review is skipped for the document. This can happen because human 24 | * review isn't enabled on the processor or the processing request has 25 | * been set to skip this document. 26 | * 27 | * Generated from protobuf enum SKIPPED = 1; 28 | */ 29 | const SKIPPED = 1; 30 | /** 31 | * Human review validation is triggered and passed, so no review is needed. 32 | * 33 | * Generated from protobuf enum VALIDATION_PASSED = 2; 34 | */ 35 | const VALIDATION_PASSED = 2; 36 | /** 37 | * Human review validation is triggered and the document is under review. 38 | * 39 | * Generated from protobuf enum IN_PROGRESS = 3; 40 | */ 41 | const IN_PROGRESS = 3; 42 | /** 43 | * Some error happened during triggering human review, see the 44 | * [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message] 45 | * for details. 46 | * 47 | * Generated from protobuf enum ERROR = 4; 48 | */ 49 | const ERROR = 4; 50 | 51 | private static $valueToName = [ 52 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 53 | self::SKIPPED => 'SKIPPED', 54 | self::VALIDATION_PASSED => 'VALIDATION_PASSED', 55 | self::IN_PROGRESS => 'IN_PROGRESS', 56 | self::ERROR => 'ERROR', 57 | ]; 58 | 59 | public static function name($value) 60 | { 61 | if (!isset(self::$valueToName[$value])) { 62 | throw new UnexpectedValueException(sprintf( 63 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 64 | } 65 | return self::$valueToName[$value]; 66 | } 67 | 68 | 69 | public static function value($name) 70 | { 71 | $const = __CLASS__ . '::' . strtoupper($name); 72 | if (!defined($const)) { 73 | throw new UnexpectedValueException(sprintf( 74 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 75 | } 76 | return constant($const); 77 | } 78 | } 79 | 80 | 81 | -------------------------------------------------------------------------------- /src/V1/ListProcessorTypesResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ListProcessorTypesResponse 17 | */ 18 | class ListProcessorTypesResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The processor types. 22 | * 23 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; 24 | */ 25 | private $processor_types; 26 | /** 27 | * Points to the next page, otherwise empty. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | protected $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $processor_types 40 | * The processor types. 41 | * @type string $next_page_token 42 | * Points to the next page, otherwise empty. 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * The processor types. 52 | * 53 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; 54 | * @return \Google\Protobuf\Internal\RepeatedField 55 | */ 56 | public function getProcessorTypes() 57 | { 58 | return $this->processor_types; 59 | } 60 | 61 | /** 62 | * The processor types. 63 | * 64 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; 65 | * @param array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $var 66 | * @return $this 67 | */ 68 | public function setProcessorTypes($var) 69 | { 70 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorType::class); 71 | $this->processor_types = $arr; 72 | 73 | return $this; 74 | } 75 | 76 | /** 77 | * Points to the next page, otherwise empty. 78 | * 79 | * Generated from protobuf field string next_page_token = 2; 80 | * @return string 81 | */ 82 | public function getNextPageToken() 83 | { 84 | return $this->next_page_token; 85 | } 86 | 87 | /** 88 | * Points to the next page, otherwise empty. 89 | * 90 | * Generated from protobuf field string next_page_token = 2; 91 | * @param string $var 92 | * @return $this 93 | */ 94 | public function setNextPageToken($var) 95 | { 96 | GPBUtil::checkString($var, True); 97 | $this->next_page_token = $var; 98 | 99 | return $this; 100 | } 101 | 102 | } 103 | 104 | -------------------------------------------------------------------------------- /src/V1/ListProcessorVersionsResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ListProcessorVersionsResponse 17 | */ 18 | class ListProcessorVersionsResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The list of processors. 22 | * 23 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; 24 | */ 25 | private $processor_versions; 26 | /** 27 | * Points to the next processor, otherwise empty. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | protected $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\DocumentAI\V1\ProcessorVersion>|\Google\Protobuf\Internal\RepeatedField $processor_versions 40 | * The list of processors. 41 | * @type string $next_page_token 42 | * Points to the next processor, otherwise empty. 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * The list of processors. 52 | * 53 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; 54 | * @return \Google\Protobuf\Internal\RepeatedField 55 | */ 56 | public function getProcessorVersions() 57 | { 58 | return $this->processor_versions; 59 | } 60 | 61 | /** 62 | * The list of processors. 63 | * 64 | * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; 65 | * @param array<\Google\Cloud\DocumentAI\V1\ProcessorVersion>|\Google\Protobuf\Internal\RepeatedField $var 66 | * @return $this 67 | */ 68 | public function setProcessorVersions($var) 69 | { 70 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorVersion::class); 71 | $this->processor_versions = $arr; 72 | 73 | return $this; 74 | } 75 | 76 | /** 77 | * Points to the next processor, otherwise empty. 78 | * 79 | * Generated from protobuf field string next_page_token = 2; 80 | * @return string 81 | */ 82 | public function getNextPageToken() 83 | { 84 | return $this->next_page_token; 85 | } 86 | 87 | /** 88 | * Points to the next processor, otherwise empty. 89 | * 90 | * Generated from protobuf field string next_page_token = 2; 91 | * @param string $var 92 | * @return $this 93 | */ 94 | public function setNextPageToken($var) 95 | { 96 | GPBUtil::checkString($var, True); 97 | $this->next_page_token = $var; 98 | 99 | return $this; 100 | } 101 | 102 | } 103 | 104 | -------------------------------------------------------------------------------- /src/V1/ListProcessorsResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ListProcessorsResponse 17 | */ 18 | class ListProcessorsResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The list of processors. 22 | * 23 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; 24 | */ 25 | private $processors; 26 | /** 27 | * Points to the next processor, otherwise empty. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | protected $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\DocumentAI\V1\Processor>|\Google\Protobuf\Internal\RepeatedField $processors 40 | * The list of processors. 41 | * @type string $next_page_token 42 | * Points to the next processor, otherwise empty. 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * The list of processors. 52 | * 53 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; 54 | * @return \Google\Protobuf\Internal\RepeatedField 55 | */ 56 | public function getProcessors() 57 | { 58 | return $this->processors; 59 | } 60 | 61 | /** 62 | * The list of processors. 63 | * 64 | * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; 65 | * @param array<\Google\Cloud\DocumentAI\V1\Processor>|\Google\Protobuf\Internal\RepeatedField $var 66 | * @return $this 67 | */ 68 | public function setProcessors($var) 69 | { 70 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Processor::class); 71 | $this->processors = $arr; 72 | 73 | return $this; 74 | } 75 | 76 | /** 77 | * Points to the next processor, otherwise empty. 78 | * 79 | * Generated from protobuf field string next_page_token = 2; 80 | * @return string 81 | */ 82 | public function getNextPageToken() 83 | { 84 | return $this->next_page_token; 85 | } 86 | 87 | /** 88 | * Points to the next processor, otherwise empty. 89 | * 90 | * Generated from protobuf field string next_page_token = 2; 91 | * @param string $var 92 | * @return $this 93 | */ 94 | public function setNextPageToken($var) 95 | { 96 | GPBUtil::checkString($var, True); 97 | $this->next_page_token = $var; 98 | 99 | return $this; 100 | } 101 | 102 | } 103 | 104 | -------------------------------------------------------------------------------- /src/V1/NormalizedVertex.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.NormalizedVertex 17 | */ 18 | class NormalizedVertex extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * X coordinate. 22 | * 23 | * Generated from protobuf field float x = 1; 24 | */ 25 | protected $x = 0.0; 26 | /** 27 | * Y coordinate (starts from the top of the image). 28 | * 29 | * Generated from protobuf field float y = 2; 30 | */ 31 | protected $y = 0.0; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type float $x 40 | * X coordinate. 41 | * @type float $y 42 | * Y coordinate (starts from the top of the image). 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Cloud\Documentai\V1\Geometry::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * X coordinate. 52 | * 53 | * Generated from protobuf field float x = 1; 54 | * @return float 55 | */ 56 | public function getX() 57 | { 58 | return $this->x; 59 | } 60 | 61 | /** 62 | * X coordinate. 63 | * 64 | * Generated from protobuf field float x = 1; 65 | * @param float $var 66 | * @return $this 67 | */ 68 | public function setX($var) 69 | { 70 | GPBUtil::checkFloat($var); 71 | $this->x = $var; 72 | 73 | return $this; 74 | } 75 | 76 | /** 77 | * Y coordinate (starts from the top of the image). 78 | * 79 | * Generated from protobuf field float y = 2; 80 | * @return float 81 | */ 82 | public function getY() 83 | { 84 | return $this->y; 85 | } 86 | 87 | /** 88 | * Y coordinate (starts from the top of the image). 89 | * 90 | * Generated from protobuf field float y = 2; 91 | * @param float $var 92 | * @return $this 93 | */ 94 | public function setY($var) 95 | { 96 | GPBUtil::checkFloat($var); 97 | $this->y = $var; 98 | 99 | return $this; 100 | } 101 | 102 | } 103 | 104 | -------------------------------------------------------------------------------- /src/V1/ProcessOptions/IndividualPageSelector.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector 15 | */ 16 | class IndividualPageSelector extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Optional. Indices of the pages (starting from 1). 20 | * 21 | * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; 22 | */ 23 | private $pages; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array|\Google\Protobuf\Internal\RepeatedField $pages 32 | * Optional. Indices of the pages (starting from 1). 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Optional. Indices of the pages (starting from 1). 42 | * 43 | * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getPages() 47 | { 48 | return $this->pages; 49 | } 50 | 51 | /** 52 | * Optional. Indices of the pages (starting from 1). 53 | * 54 | * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; 55 | * @param array|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setPages($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); 61 | $this->pages = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig 15 | */ 16 | class ChunkingConfig extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Optional. The chunk sizes to use when splitting documents, in order of 20 | * level. 21 | * 22 | * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; 23 | */ 24 | protected $chunk_size = 0; 25 | /** 26 | * Optional. Whether or not to include ancestor headings when splitting. 27 | * 28 | * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; 29 | */ 30 | protected $include_ancestor_headings = false; 31 | 32 | /** 33 | * Constructor. 34 | * 35 | * @param array $data { 36 | * Optional. Data for populating the Message object. 37 | * 38 | * @type int $chunk_size 39 | * Optional. The chunk sizes to use when splitting documents, in order of 40 | * level. 41 | * @type bool $include_ancestor_headings 42 | * Optional. Whether or not to include ancestor headings when splitting. 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * Optional. The chunk sizes to use when splitting documents, in order of 52 | * level. 53 | * 54 | * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; 55 | * @return int 56 | */ 57 | public function getChunkSize() 58 | { 59 | return $this->chunk_size; 60 | } 61 | 62 | /** 63 | * Optional. The chunk sizes to use when splitting documents, in order of 64 | * level. 65 | * 66 | * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; 67 | * @param int $var 68 | * @return $this 69 | */ 70 | public function setChunkSize($var) 71 | { 72 | GPBUtil::checkInt32($var); 73 | $this->chunk_size = $var; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * Optional. Whether or not to include ancestor headings when splitting. 80 | * 81 | * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; 82 | * @return bool 83 | */ 84 | public function getIncludeAncestorHeadings() 85 | { 86 | return $this->include_ancestor_headings; 87 | } 88 | 89 | /** 90 | * Optional. Whether or not to include ancestor headings when splitting. 91 | * 92 | * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; 93 | * @param bool $var 94 | * @return $this 95 | */ 96 | public function setIncludeAncestorHeadings($var) 97 | { 98 | GPBUtil::checkBool($var); 99 | $this->include_ancestor_headings = $var; 100 | 101 | return $this; 102 | } 103 | 104 | } 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/V1/Processor/State.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Processor.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * The processor is in an unspecified state. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * The processor is enabled, i.e., has an enabled version which can 24 | * currently serve processing requests and all the feature dependencies have 25 | * been successfully initialized. 26 | * 27 | * Generated from protobuf enum ENABLED = 1; 28 | */ 29 | const ENABLED = 1; 30 | /** 31 | * The processor is disabled. 32 | * 33 | * Generated from protobuf enum DISABLED = 2; 34 | */ 35 | const DISABLED = 2; 36 | /** 37 | * The processor is being enabled, will become `ENABLED` if successful. 38 | * 39 | * Generated from protobuf enum ENABLING = 3; 40 | */ 41 | const ENABLING = 3; 42 | /** 43 | * The processor is being disabled, will become `DISABLED` if successful. 44 | * 45 | * Generated from protobuf enum DISABLING = 4; 46 | */ 47 | const DISABLING = 4; 48 | /** 49 | * The processor is being created, will become either `ENABLED` (for 50 | * successful creation) or `FAILED` (for failed ones). 51 | * Once a processor is in this state, it can then be used for document 52 | * processing, but the feature dependencies of the processor might not be 53 | * fully created yet. 54 | * 55 | * Generated from protobuf enum CREATING = 5; 56 | */ 57 | const CREATING = 5; 58 | /** 59 | * The processor failed during creation or initialization of feature 60 | * dependencies. The user should delete the processor and recreate one as 61 | * all the functionalities of the processor are disabled. 62 | * 63 | * Generated from protobuf enum FAILED = 6; 64 | */ 65 | const FAILED = 6; 66 | /** 67 | * The processor is being deleted, will be removed if successful. 68 | * 69 | * Generated from protobuf enum DELETING = 7; 70 | */ 71 | const DELETING = 7; 72 | 73 | private static $valueToName = [ 74 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 75 | self::ENABLED => 'ENABLED', 76 | self::DISABLED => 'DISABLED', 77 | self::ENABLING => 'ENABLING', 78 | self::DISABLING => 'DISABLING', 79 | self::CREATING => 'CREATING', 80 | self::FAILED => 'FAILED', 81 | self::DELETING => 'DELETING', 82 | ]; 83 | 84 | public static function name($value) 85 | { 86 | if (!isset(self::$valueToName[$value])) { 87 | throw new UnexpectedValueException(sprintf( 88 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 89 | } 90 | return self::$valueToName[$value]; 91 | } 92 | 93 | 94 | public static function value($name) 95 | { 96 | $const = __CLASS__ . '::' . strtoupper($name); 97 | if (!defined($const)) { 98 | throw new UnexpectedValueException(sprintf( 99 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 100 | } 101 | return constant($const); 102 | } 103 | } 104 | 105 | 106 | -------------------------------------------------------------------------------- /src/V1/ProcessorType/LocationInfo.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ProcessorType.LocationInfo 15 | */ 16 | class LocationInfo extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The location ID. For supported locations, refer to [regional and 20 | * multi-regional support](/document-ai/docs/regions). 21 | * 22 | * Generated from protobuf field string location_id = 1; 23 | */ 24 | protected $location_id = ''; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type string $location_id 33 | * The location ID. For supported locations, refer to [regional and 34 | * multi-regional support](/document-ai/docs/regions). 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\ProcessorType::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The location ID. For supported locations, refer to [regional and 44 | * multi-regional support](/document-ai/docs/regions). 45 | * 46 | * Generated from protobuf field string location_id = 1; 47 | * @return string 48 | */ 49 | public function getLocationId() 50 | { 51 | return $this->location_id; 52 | } 53 | 54 | /** 55 | * The location ID. For supported locations, refer to [regional and 56 | * multi-regional support](/document-ai/docs/regions). 57 | * 58 | * Generated from protobuf field string location_id = 1; 59 | * @param string $var 60 | * @return $this 61 | */ 62 | public function setLocationId($var) 63 | { 64 | GPBUtil::checkString($var, True); 65 | $this->location_id = $var; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType 13 | */ 14 | class CustomModelType 15 | { 16 | /** 17 | * The model type is unspecified. 18 | * 19 | * Generated from protobuf enum CUSTOM_MODEL_TYPE_UNSPECIFIED = 0; 20 | */ 21 | const CUSTOM_MODEL_TYPE_UNSPECIFIED = 0; 22 | /** 23 | * The model is a versioned foundation model. 24 | * 25 | * Generated from protobuf enum VERSIONED_FOUNDATION = 1; 26 | */ 27 | const VERSIONED_FOUNDATION = 1; 28 | /** 29 | * The model is a finetuned foundation model. 30 | * 31 | * Generated from protobuf enum FINE_TUNED = 2; 32 | */ 33 | const FINE_TUNED = 2; 34 | 35 | private static $valueToName = [ 36 | self::CUSTOM_MODEL_TYPE_UNSPECIFIED => 'CUSTOM_MODEL_TYPE_UNSPECIFIED', 37 | self::VERSIONED_FOUNDATION => 'VERSIONED_FOUNDATION', 38 | self::FINE_TUNED => 'FINE_TUNED', 39 | ]; 40 | 41 | public static function name($value) 42 | { 43 | if (!isset(self::$valueToName[$value])) { 44 | throw new UnexpectedValueException(sprintf( 45 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 46 | } 47 | return self::$valueToName[$value]; 48 | } 49 | 50 | 51 | public static function value($name) 52 | { 53 | $const = __CLASS__ . '::' . strtoupper($name); 54 | if (!defined($const)) { 55 | throw new UnexpectedValueException(sprintf( 56 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 57 | } 58 | return constant($const); 59 | } 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo 15 | */ 16 | class FoundationGenAiModelInfo extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Whether finetuning is allowed for this base processor version. 20 | * 21 | * Generated from protobuf field bool finetuning_allowed = 1; 22 | */ 23 | protected $finetuning_allowed = false; 24 | /** 25 | * The minimum number of labeled documents in the training dataset 26 | * required for finetuning. 27 | * 28 | * Generated from protobuf field int32 min_train_labeled_documents = 2; 29 | */ 30 | protected $min_train_labeled_documents = 0; 31 | 32 | /** 33 | * Constructor. 34 | * 35 | * @param array $data { 36 | * Optional. Data for populating the Message object. 37 | * 38 | * @type bool $finetuning_allowed 39 | * Whether finetuning is allowed for this base processor version. 40 | * @type int $min_train_labeled_documents 41 | * The minimum number of labeled documents in the training dataset 42 | * required for finetuning. 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * Whether finetuning is allowed for this base processor version. 52 | * 53 | * Generated from protobuf field bool finetuning_allowed = 1; 54 | * @return bool 55 | */ 56 | public function getFinetuningAllowed() 57 | { 58 | return $this->finetuning_allowed; 59 | } 60 | 61 | /** 62 | * Whether finetuning is allowed for this base processor version. 63 | * 64 | * Generated from protobuf field bool finetuning_allowed = 1; 65 | * @param bool $var 66 | * @return $this 67 | */ 68 | public function setFinetuningAllowed($var) 69 | { 70 | GPBUtil::checkBool($var); 71 | $this->finetuning_allowed = $var; 72 | 73 | return $this; 74 | } 75 | 76 | /** 77 | * The minimum number of labeled documents in the training dataset 78 | * required for finetuning. 79 | * 80 | * Generated from protobuf field int32 min_train_labeled_documents = 2; 81 | * @return int 82 | */ 83 | public function getMinTrainLabeledDocuments() 84 | { 85 | return $this->min_train_labeled_documents; 86 | } 87 | 88 | /** 89 | * The minimum number of labeled documents in the training dataset 90 | * required for finetuning. 91 | * 92 | * Generated from protobuf field int32 min_train_labeled_documents = 2; 93 | * @param int $var 94 | * @return $this 95 | */ 96 | public function setMinTrainLabeledDocuments($var) 97 | { 98 | GPBUtil::checkInt32($var); 99 | $this->min_train_labeled_documents = $var; 100 | 101 | return $this; 102 | } 103 | 104 | } 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/V1/ProcessorVersion/ModelType.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ProcessorVersion.ModelType 13 | */ 14 | class ModelType 15 | { 16 | /** 17 | * The processor version has unspecified model type. 18 | * 19 | * Generated from protobuf enum MODEL_TYPE_UNSPECIFIED = 0; 20 | */ 21 | const MODEL_TYPE_UNSPECIFIED = 0; 22 | /** 23 | * The processor version has generative model type. 24 | * 25 | * Generated from protobuf enum MODEL_TYPE_GENERATIVE = 1; 26 | */ 27 | const MODEL_TYPE_GENERATIVE = 1; 28 | /** 29 | * The processor version has custom model type. 30 | * 31 | * Generated from protobuf enum MODEL_TYPE_CUSTOM = 2; 32 | */ 33 | const MODEL_TYPE_CUSTOM = 2; 34 | 35 | private static $valueToName = [ 36 | self::MODEL_TYPE_UNSPECIFIED => 'MODEL_TYPE_UNSPECIFIED', 37 | self::MODEL_TYPE_GENERATIVE => 'MODEL_TYPE_GENERATIVE', 38 | self::MODEL_TYPE_CUSTOM => 'MODEL_TYPE_CUSTOM', 39 | ]; 40 | 41 | public static function name($value) 42 | { 43 | if (!isset(self::$valueToName[$value])) { 44 | throw new UnexpectedValueException(sprintf( 45 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 46 | } 47 | return self::$valueToName[$value]; 48 | } 49 | 50 | 51 | public static function value($name) 52 | { 53 | $const = __CLASS__ . '::' . strtoupper($name); 54 | if (!defined($const)) { 55 | throw new UnexpectedValueException(sprintf( 56 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 57 | } 58 | return constant($const); 59 | } 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/V1/ProcessorVersion/State.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ProcessorVersion.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * The processor version is in an unspecified state. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * The processor version is deployed and can be used for processing. 24 | * 25 | * Generated from protobuf enum DEPLOYED = 1; 26 | */ 27 | const DEPLOYED = 1; 28 | /** 29 | * The processor version is being deployed. 30 | * 31 | * Generated from protobuf enum DEPLOYING = 2; 32 | */ 33 | const DEPLOYING = 2; 34 | /** 35 | * The processor version is not deployed and cannot be used for processing. 36 | * 37 | * Generated from protobuf enum UNDEPLOYED = 3; 38 | */ 39 | const UNDEPLOYED = 3; 40 | /** 41 | * The processor version is being undeployed. 42 | * 43 | * Generated from protobuf enum UNDEPLOYING = 4; 44 | */ 45 | const UNDEPLOYING = 4; 46 | /** 47 | * The processor version is being created. 48 | * 49 | * Generated from protobuf enum CREATING = 5; 50 | */ 51 | const CREATING = 5; 52 | /** 53 | * The processor version is being deleted. 54 | * 55 | * Generated from protobuf enum DELETING = 6; 56 | */ 57 | const DELETING = 6; 58 | /** 59 | * The processor version failed and is in an indeterminate state. 60 | * 61 | * Generated from protobuf enum FAILED = 7; 62 | */ 63 | const FAILED = 7; 64 | /** 65 | * The processor version is being imported. 66 | * 67 | * Generated from protobuf enum IMPORTING = 8; 68 | */ 69 | const IMPORTING = 8; 70 | 71 | private static $valueToName = [ 72 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 73 | self::DEPLOYED => 'DEPLOYED', 74 | self::DEPLOYING => 'DEPLOYING', 75 | self::UNDEPLOYED => 'UNDEPLOYED', 76 | self::UNDEPLOYING => 'UNDEPLOYING', 77 | self::CREATING => 'CREATING', 78 | self::DELETING => 'DELETING', 79 | self::FAILED => 'FAILED', 80 | self::IMPORTING => 'IMPORTING', 81 | ]; 82 | 83 | public static function name($value) 84 | { 85 | if (!isset(self::$valueToName[$value])) { 86 | throw new UnexpectedValueException(sprintf( 87 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 88 | } 89 | return self::$valueToName[$value]; 90 | } 91 | 92 | 93 | public static function value($name) 94 | { 95 | $const = __CLASS__ . '::' . strtoupper($name); 96 | if (!defined($const)) { 97 | throw new UnexpectedValueException(sprintf( 98 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 99 | } 100 | return constant($const); 101 | } 102 | } 103 | 104 | 105 | -------------------------------------------------------------------------------- /src/V1/ProcessorVersionAlias.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ProcessorVersionAlias 15 | */ 16 | class ProcessorVersionAlias extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The alias in the form of `processor_version` resource name. 20 | * 21 | * Generated from protobuf field string alias = 1; 22 | */ 23 | protected $alias = ''; 24 | /** 25 | * The resource name of aliased processor version. 26 | * 27 | * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { 28 | */ 29 | protected $processor_version = ''; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $alias 38 | * The alias in the form of `processor_version` resource name. 39 | * @type string $processor_version 40 | * The resource name of aliased processor version. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The alias in the form of `processor_version` resource name. 50 | * 51 | * Generated from protobuf field string alias = 1; 52 | * @return string 53 | */ 54 | public function getAlias() 55 | { 56 | return $this->alias; 57 | } 58 | 59 | /** 60 | * The alias in the form of `processor_version` resource name. 61 | * 62 | * Generated from protobuf field string alias = 1; 63 | * @param string $var 64 | * @return $this 65 | */ 66 | public function setAlias($var) 67 | { 68 | GPBUtil::checkString($var, True); 69 | $this->alias = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * The resource name of aliased processor version. 76 | * 77 | * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { 78 | * @return string 79 | */ 80 | public function getProcessorVersion() 81 | { 82 | return $this->processor_version; 83 | } 84 | 85 | /** 86 | * The resource name of aliased processor version. 87 | * 88 | * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { 89 | * @param string $var 90 | * @return $this 91 | */ 92 | public function setProcessorVersion($var) 93 | { 94 | GPBUtil::checkString($var, True); 95 | $this->processor_version = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | -------------------------------------------------------------------------------- /src/V1/ReviewDocumentRequest/Priority.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ReviewDocumentRequest.Priority 13 | */ 14 | class Priority 15 | { 16 | /** 17 | * The default priority level. 18 | * 19 | * Generated from protobuf enum DEFAULT = 0; 20 | */ 21 | const PBDEFAULT = 0; 22 | /** 23 | * The urgent priority level. The labeling manager should allocate labeler 24 | * resource to the urgent task queue to respect this priority level. 25 | * 26 | * Generated from protobuf enum URGENT = 1; 27 | */ 28 | const URGENT = 1; 29 | 30 | private static $valueToName = [ 31 | self::PBDEFAULT => 'DEFAULT', 32 | self::URGENT => 'URGENT', 33 | ]; 34 | 35 | public static function name($value) 36 | { 37 | if (!isset(self::$valueToName[$value])) { 38 | throw new UnexpectedValueException(sprintf( 39 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 40 | } 41 | return self::$valueToName[$value]; 42 | } 43 | 44 | 45 | public static function value($name) 46 | { 47 | $const = __CLASS__ . '::' . strtoupper($name); 48 | if (!defined($const)) { 49 | $pbconst = __CLASS__. '::PB' . strtoupper($name); 50 | if (!defined($pbconst)) { 51 | throw new UnexpectedValueException(sprintf( 52 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 53 | } 54 | return constant($pbconst); 55 | } 56 | return constant($const); 57 | } 58 | } 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/V1/ReviewDocumentResponse/State.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.ReviewDocumentResponse.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * The default value. This value is used if the state is omitted. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * The review operation is rejected by the reviewer. 24 | * 25 | * Generated from protobuf enum REJECTED = 1; 26 | */ 27 | const REJECTED = 1; 28 | /** 29 | * The review operation is succeeded. 30 | * 31 | * Generated from protobuf enum SUCCEEDED = 2; 32 | */ 33 | const SUCCEEDED = 2; 34 | 35 | private static $valueToName = [ 36 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 37 | self::REJECTED => 'REJECTED', 38 | self::SUCCEEDED => 'SUCCEEDED', 39 | ]; 40 | 41 | public static function name($value) 42 | { 43 | if (!isset(self::$valueToName[$value])) { 44 | throw new UnexpectedValueException(sprintf( 45 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 46 | } 47 | return self::$valueToName[$value]; 48 | } 49 | 50 | 51 | public static function value($name) 52 | { 53 | $const = __CLASS__ . '::' . strtoupper($name); 54 | if (!defined($const)) { 55 | throw new UnexpectedValueException(sprintf( 56 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 57 | } 58 | return constant($const); 59 | } 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/V1/SetDefaultProcessorVersionMetadata.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata 17 | */ 18 | class SetDefaultProcessorVersionMetadata extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The basic metadata of the long-running operation. 22 | * 23 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 24 | */ 25 | protected $common_metadata = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata 34 | * The basic metadata of the long-running operation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The basic metadata of the long-running operation. 44 | * 45 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 46 | * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null 47 | */ 48 | public function getCommonMetadata() 49 | { 50 | return $this->common_metadata; 51 | } 52 | 53 | public function hasCommonMetadata() 54 | { 55 | return isset($this->common_metadata); 56 | } 57 | 58 | public function clearCommonMetadata() 59 | { 60 | unset($this->common_metadata); 61 | } 62 | 63 | /** 64 | * The basic metadata of the long-running operation. 65 | * 66 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 67 | * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var 68 | * @return $this 69 | */ 70 | public function setCommonMetadata($var) 71 | { 72 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); 73 | $this->common_metadata = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V1/SetDefaultProcessorVersionResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.SetDefaultProcessorVersionResponse 17 | */ 18 | class SetDefaultProcessorVersionResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * } 28 | */ 29 | public function __construct($data = NULL) { 30 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 31 | parent::__construct($data); 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions 16 | */ 17 | class CustomDocumentExtractionOptions extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * Training method to use for CDE training. 21 | * 22 | * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; 23 | */ 24 | protected $training_method = 0; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type int $training_method 33 | * Training method to use for CDE training. 34 | * } 35 | */ 36 | public function __construct($data = NULL) { 37 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 38 | parent::__construct($data); 39 | } 40 | 41 | /** 42 | * Training method to use for CDE training. 43 | * 44 | * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; 45 | * @return int 46 | */ 47 | public function getTrainingMethod() 48 | { 49 | return $this->training_method; 50 | } 51 | 52 | /** 53 | * Training method to use for CDE training. 54 | * 55 | * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; 56 | * @param int $var 57 | * @return $this 58 | */ 59 | public function setTrainingMethod($var) 60 | { 61 | GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions\TrainingMethod::class); 62 | $this->training_method = $var; 63 | 64 | return $this; 65 | } 66 | 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod 14 | */ 15 | class TrainingMethod 16 | { 17 | /** 18 | * Generated from protobuf enum TRAINING_METHOD_UNSPECIFIED = 0; 19 | */ 20 | const TRAINING_METHOD_UNSPECIFIED = 0; 21 | /** 22 | * Generated from protobuf enum MODEL_BASED = 1; 23 | */ 24 | const MODEL_BASED = 1; 25 | /** 26 | * Generated from protobuf enum TEMPLATE_BASED = 2; 27 | */ 28 | const TEMPLATE_BASED = 2; 29 | 30 | private static $valueToName = [ 31 | self::TRAINING_METHOD_UNSPECIFIED => 'TRAINING_METHOD_UNSPECIFIED', 32 | self::MODEL_BASED => 'MODEL_BASED', 33 | self::TEMPLATE_BASED => 'TEMPLATE_BASED', 34 | ]; 35 | 36 | public static function name($value) 37 | { 38 | if (!isset(self::$valueToName[$value])) { 39 | throw new UnexpectedValueException(sprintf( 40 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 41 | } 42 | return self::$valueToName[$value]; 43 | } 44 | 45 | 46 | public static function value($name) 47 | { 48 | $const = __CLASS__ . '::' . strtoupper($name); 49 | if (!defined($const)) { 50 | throw new UnexpectedValueException(sprintf( 51 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 52 | } 53 | return constant($const); 54 | } 55 | } 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/V1/TrainProcessorVersionResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.TrainProcessorVersionResponse 16 | */ 17 | class TrainProcessorVersionResponse extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * The resource name of the processor version produced by training. 21 | * 22 | * Generated from protobuf field string processor_version = 1; 23 | */ 24 | protected $processor_version = ''; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type string $processor_version 33 | * The resource name of the processor version produced by training. 34 | * } 35 | */ 36 | public function __construct($data = NULL) { 37 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 38 | parent::__construct($data); 39 | } 40 | 41 | /** 42 | * The resource name of the processor version produced by training. 43 | * 44 | * Generated from protobuf field string processor_version = 1; 45 | * @return string 46 | */ 47 | public function getProcessorVersion() 48 | { 49 | return $this->processor_version; 50 | } 51 | 52 | /** 53 | * The resource name of the processor version produced by training. 54 | * 55 | * Generated from protobuf field string processor_version = 1; 56 | * @param string $var 57 | * @return $this 58 | */ 59 | public function setProcessorVersion($var) 60 | { 61 | GPBUtil::checkString($var, True); 62 | $this->processor_version = $var; 63 | 64 | return $this; 65 | } 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/V1/UndeployProcessorVersionMetadata.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.UndeployProcessorVersionMetadata 17 | */ 18 | class UndeployProcessorVersionMetadata extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * The basic metadata of the long-running operation. 22 | * 23 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 24 | */ 25 | protected $common_metadata = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata 34 | * The basic metadata of the long-running operation. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * The basic metadata of the long-running operation. 44 | * 45 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 46 | * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null 47 | */ 48 | public function getCommonMetadata() 49 | { 50 | return $this->common_metadata; 51 | } 52 | 53 | public function hasCommonMetadata() 54 | { 55 | return isset($this->common_metadata); 56 | } 57 | 58 | public function clearCommonMetadata() 59 | { 60 | unset($this->common_metadata); 61 | } 62 | 63 | /** 64 | * The basic metadata of the long-running operation. 65 | * 66 | * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; 67 | * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var 68 | * @return $this 69 | */ 70 | public function setCommonMetadata($var) 71 | { 72 | GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); 73 | $this->common_metadata = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V1/UndeployProcessorVersionRequest.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.UndeployProcessorVersionRequest 17 | */ 18 | class UndeployProcessorVersionRequest extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * Required. The processor version resource name to be undeployed. 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The processor version resource name to be undeployed. Please see 29 | * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. 30 | * 31 | * @return \Google\Cloud\DocumentAI\V1\UndeployProcessorVersionRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The processor version resource name to be undeployed. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * Required. The processor version resource name to be undeployed. 58 | * 59 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 60 | * @return string 61 | */ 62 | public function getName() 63 | { 64 | return $this->name; 65 | } 66 | 67 | /** 68 | * Required. The processor version resource name to be undeployed. 69 | * 70 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 71 | * @param string $var 72 | * @return $this 73 | */ 74 | public function setName($var) 75 | { 76 | GPBUtil::checkString($var, True); 77 | $this->name = $var; 78 | 79 | return $this; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/V1/UndeployProcessorVersionResponse.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.UndeployProcessorVersionResponse 17 | */ 18 | class UndeployProcessorVersionResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * } 28 | */ 29 | public function __construct($data = NULL) { 30 | \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); 31 | parent::__construct($data); 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/V1/Vertex.php: -------------------------------------------------------------------------------- 1 | google.cloud.documentai.v1.Vertex 16 | */ 17 | class Vertex extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * X coordinate. 21 | * 22 | * Generated from protobuf field int32 x = 1; 23 | */ 24 | protected $x = 0; 25 | /** 26 | * Y coordinate (starts from the top of the image). 27 | * 28 | * Generated from protobuf field int32 y = 2; 29 | */ 30 | protected $y = 0; 31 | 32 | /** 33 | * Constructor. 34 | * 35 | * @param array $data { 36 | * Optional. Data for populating the Message object. 37 | * 38 | * @type int $x 39 | * X coordinate. 40 | * @type int $y 41 | * Y coordinate (starts from the top of the image). 42 | * } 43 | */ 44 | public function __construct($data = NULL) { 45 | \GPBMetadata\Google\Cloud\Documentai\V1\Geometry::initOnce(); 46 | parent::__construct($data); 47 | } 48 | 49 | /** 50 | * X coordinate. 51 | * 52 | * Generated from protobuf field int32 x = 1; 53 | * @return int 54 | */ 55 | public function getX() 56 | { 57 | return $this->x; 58 | } 59 | 60 | /** 61 | * X coordinate. 62 | * 63 | * Generated from protobuf field int32 x = 1; 64 | * @param int $var 65 | * @return $this 66 | */ 67 | public function setX($var) 68 | { 69 | GPBUtil::checkInt32($var); 70 | $this->x = $var; 71 | 72 | return $this; 73 | } 74 | 75 | /** 76 | * Y coordinate (starts from the top of the image). 77 | * 78 | * Generated from protobuf field int32 y = 2; 79 | * @return int 80 | */ 81 | public function getY() 82 | { 83 | return $this->y; 84 | } 85 | 86 | /** 87 | * Y coordinate (starts from the top of the image). 88 | * 89 | * Generated from protobuf field int32 y = 2; 90 | * @param int $var 91 | * @return $this 92 | */ 93 | public function setY($var) 94 | { 95 | GPBUtil::checkInt32($var); 96 | $this->y = $var; 97 | 98 | return $this; 99 | } 100 | 101 | } 102 | 103 | --------------------------------------------------------------------------------