From 67a88a7f25cda2830a85765443de96651964a36a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 2 Aug 2024 18:54:36 +0000 Subject: [PATCH 1/2] feat: A new field `imageless_mode` is added to message `.google.cloud.documentai.v1.ProcessRequest` feat: A new field `gen_ai_model_info` is added to message `.google.cloud.documentai.v1.ProcessorVersion` PiperOrigin-RevId: 658521163 Source-Link: https://github.com/googleapis/googleapis/commit/f7bcaabac15d66e3d2ca6a8bfcc7b7c6daf3c2b7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/799a34ca31f9a1ee21a47e095ff2a9fa09bd79d8 Copy-Tag: eyJwIjoiRG9jdW1lbnRBaS8uT3dsQm90LnlhbWwiLCJoIjoiNzk5YTM0Y2EzMWY5YTFlZTIxYTQ3ZTA5NWZmMmE5ZmEwOWJkNzlkOCJ9 --- .../Google/Cloud/Documentai/V1/Barcode.php | 31 + .../Google/Cloud/Documentai/V1/Document.php | Bin 0 -> 13032 bytes .../Google/Cloud/Documentai/V1/DocumentIo.php | Bin 0 -> 2208 bytes .../V1/DocumentProcessorService.php | Bin 0 -> 17082 bytes .../Cloud/Documentai/V1/DocumentSchema.php | Bin 0 -> 1829 bytes .../Google/Cloud/Documentai/V1/Evaluation.php | Bin 0 -> 3028 bytes .../Google/Cloud/Documentai/V1/Geometry.php | 36 + .../Cloud/Documentai/V1/OperationMetadata.php | Bin 0 -> 1280 bytes .../Google/Cloud/Documentai/V1/Processor.php | Bin 0 -> 4080 bytes .../Cloud/Documentai/V1/ProcessorType.php | 40 + .../Google/Cloud/DocumentAI/V1/Barcode.php | 255 ++ .../V1/BatchDocumentsInputConfig.php | 108 + .../DocumentAI/V1/BatchProcessMetadata.php | 228 ++ .../IndividualProcessStatus.php | 208 ++ .../V1/BatchProcessMetadata/State.php | 92 + .../DocumentAI/V1/BatchProcessRequest.php | 342 +++ .../DocumentAI/V1/BatchProcessResponse.php | 34 + .../Cloud/DocumentAI/V1/BoundingPoly.php | 101 + .../DocumentAI/V1/CommonOperationMetadata.php | 223 ++ .../V1/CommonOperationMetadata/State.php | 85 + .../DocumentAI/V1/CreateProcessorRequest.php | 161 ++ .../DocumentAI/V1/DeleteProcessorMetadata.php | 79 + .../DocumentAI/V1/DeleteProcessorRequest.php | 83 + .../V1/DeleteProcessorVersionMetadata.php | 79 + .../V1/DeleteProcessorVersionRequest.php | 83 + .../V1/DeployProcessorVersionMetadata.php | 79 + .../V1/DeployProcessorVersionRequest.php | 83 + .../V1/DeployProcessorVersionResponse.php | 35 + .../V1/DisableProcessorMetadata.php | 79 + .../DocumentAI/V1/DisableProcessorRequest.php | 69 + .../V1/DisableProcessorResponse.php | 35 + .../Google/Cloud/DocumentAI/V1/Document.php | 611 +++++ .../V1/Document/ChunkedDocument.php | 70 + .../V1/Document/ChunkedDocument/Chunk.php | 250 ++ .../ChunkedDocument/Chunk/ChunkPageFooter.php | 114 + .../ChunkedDocument/Chunk/ChunkPageHeader.php | 114 + .../ChunkedDocument/Chunk/ChunkPageSpan.php | 104 + .../DocumentAI/V1/Document/DocumentLayout.php | 71 + .../DocumentLayout/DocumentLayoutBlock.php | 223 ++ .../DocumentLayoutBlock/LayoutListBlock.php | 108 + .../DocumentLayoutBlock/LayoutListEntry.php | 74 + .../DocumentLayoutBlock/LayoutPageSpan.php | 104 + .../DocumentLayoutBlock/LayoutTableBlock.php | 138 + .../DocumentLayoutBlock/LayoutTableCell.php | 142 + .../DocumentLayoutBlock/LayoutTableRow.php | 70 + .../DocumentLayoutBlock/LayoutTextBlock.php | 150 + .../Cloud/DocumentAI/V1/Document/Entity.php | 488 ++++ .../V1/Document/Entity/NormalizedValue.php | 357 +++ .../DocumentAI/V1/Document/EntityRelation.php | 139 + .../Cloud/DocumentAI/V1/Document/Page.php | 719 +++++ .../DocumentAI/V1/Document/Page/Block.php | 170 ++ .../V1/Document/Page/DetectedBarcode.php | 132 + .../V1/Document/Page/DetectedLanguage.php | 112 + .../DocumentAI/V1/Document/Page/Dimension.php | 138 + .../DocumentAI/V1/Document/Page/FormField.php | 382 +++ .../DocumentAI/V1/Document/Page/Image.php | 180 ++ .../V1/Document/Page/ImageQualityScores.php | 104 + .../ImageQualityScores/DetectedDefect.php | 140 + .../DocumentAI/V1/Document/Page/Layout.php | 220 ++ .../V1/Document/Page/Layout/Orientation.php | 81 + .../DocumentAI/V1/Document/Page/Line.php | 170 ++ .../DocumentAI/V1/Document/Page/Matrix.php | 185 ++ .../DocumentAI/V1/Document/Page/Paragraph.php | 169 ++ .../DocumentAI/V1/Document/Page/Symbol.php | 118 + .../DocumentAI/V1/Document/Page/Table.php | 237 ++ .../V1/Document/Page/Table/TableCell.php | 186 ++ .../V1/Document/Page/Table/TableRow.php | 70 + .../DocumentAI/V1/Document/Page/Token.php | 261 ++ .../V1/Document/Page/Token/DetectedBreak.php | 71 + .../Page/Token/DetectedBreak/Type.php | 71 + .../V1/Document/Page/Token/StyleInfo.php | 586 ++++ .../V1/Document/Page/VisualElement.php | 157 ++ .../DocumentAI/V1/Document/PageAnchor.php | 73 + .../V1/Document/PageAnchor/PageRef.php | 265 ++ .../PageAnchor/PageRef/LayoutType.php | 112 + .../DocumentAI/V1/Document/Provenance.php | 187 ++ .../V1/Document/Provenance/OperationType.php | 105 + .../V1/Document/Provenance/PBParent.php | 148 + .../Cloud/DocumentAI/V1/Document/Revision.php | 336 +++ .../V1/Document/Revision/HumanReview.php | 108 + .../DocumentAI/V1/Document/ShardInfo.php | 148 + .../Cloud/DocumentAI/V1/Document/Style.php | 377 +++ .../DocumentAI/V1/Document/Style/FontSize.php | 108 + .../DocumentAI/V1/Document/TextAnchor.php | 117 + .../V1/Document/TextAnchor/TextSegment.php | 124 + .../DocumentAI/V1/Document/TextChange.php | 173 ++ .../DocumentAI/V1/DocumentOutputConfig.php | 76 + .../DocumentOutputConfig/GcsOutputConfig.php | 166 ++ .../GcsOutputConfig/ShardingConfig.php | 104 + .../Cloud/DocumentAI/V1/DocumentSchema.php | 179 ++ .../V1/DocumentSchema/EntityType.php | 276 ++ .../DocumentSchema/EntityType/EnumValues.php | 70 + .../V1/DocumentSchema/EntityType/Property.php | 184 ++ .../EntityType/Property/OccurrenceType.php | 88 + .../DocumentAI/V1/DocumentSchema/Metadata.php | 192 ++ .../DocumentAI/V1/EnableProcessorMetadata.php | 79 + .../DocumentAI/V1/EnableProcessorRequest.php | 69 + .../DocumentAI/V1/EnableProcessorResponse.php | 35 + .../V1/EvaluateProcessorVersionMetadata.php | 79 + .../V1/EvaluateProcessorVersionRequest.php | 146 + .../V1/EvaluateProcessorVersionResponse.php | 69 + .../Google/Cloud/DocumentAI/V1/Evaluation.php | 309 +++ .../V1/Evaluation/ConfidenceLevelMetrics.php | 114 + .../DocumentAI/V1/Evaluation/Counters.php | 180 ++ .../DocumentAI/V1/Evaluation/Metrics.php | 410 +++ .../V1/Evaluation/MultiConfidenceMetrics.php | 290 ++ .../MultiConfidenceMetrics/MetricsType.php | 63 + .../DocumentAI/V1/EvaluationReference.php | 189 ++ .../V1/FetchProcessorTypesRequest.php | 89 + .../V1/FetchProcessorTypesResponse.php | 69 + .../Cloud/DocumentAI/V1/GcsDocument.php | 101 + .../Cloud/DocumentAI/V1/GcsDocuments.php | 67 + .../Google/Cloud/DocumentAI/V1/GcsPrefix.php | 67 + .../DocumentAI/V1/GetEvaluationRequest.php | 91 + .../DocumentAI/V1/GetProcessorRequest.php | 83 + .../DocumentAI/V1/GetProcessorTypeRequest.php | 83 + .../V1/GetProcessorVersionRequest.php | 83 + .../Cloud/DocumentAI/V1/HumanReviewStatus.php | 155 ++ .../DocumentAI/V1/HumanReviewStatus/State.php | 82 + .../DocumentAI/V1/ListEvaluationsRequest.php | 177 ++ .../DocumentAI/V1/ListEvaluationsResponse.php | 105 + .../V1/ListProcessorTypesRequest.php | 165 ++ .../V1/ListProcessorTypesResponse.php | 103 + .../V1/ListProcessorVersionsRequest.php | 171 ++ .../V1/ListProcessorVersionsResponse.php | 103 + .../DocumentAI/V1/ListProcessorsRequest.php | 166 ++ .../DocumentAI/V1/ListProcessorsResponse.php | 103 + .../Cloud/DocumentAI/V1/NormalizedVertex.php | 103 + .../Google/Cloud/DocumentAI/V1/OcrConfig.php | 378 +++ .../Cloud/DocumentAI/V1/OcrConfig/Hints.php | 90 + .../V1/OcrConfig/PremiumFeatures.php | 142 + .../Cloud/DocumentAI/V1/ProcessOptions.php | 300 ++ .../ProcessOptions/IndividualPageSelector.php | 70 + .../V1/ProcessOptions/LayoutConfig.php | 80 + .../LayoutConfig/ChunkingConfig.php | 108 + .../Cloud/DocumentAI/V1/ProcessRequest.php | 457 ++++ .../Cloud/DocumentAI/V1/ProcessResponse.php | 127 + .../Google/Cloud/DocumentAI/V1/Processor.php | 438 +++ .../Cloud/DocumentAI/V1/Processor/State.php | 107 + .../Cloud/DocumentAI/V1/ProcessorType.php | 280 ++ .../V1/ProcessorType/LocationInfo.php | 74 + .../Cloud/DocumentAI/V1/ProcessorVersion.php | 574 ++++ .../V1/ProcessorVersion/DeprecationInfo.php | 114 + .../V1/ProcessorVersion/GenAiModelInfo.php | 111 + .../GenAiModelInfo/CustomGenAiModelInfo.php | 106 + .../CustomGenAiModelInfo/CustomModelType.php | 64 + .../FoundationGenAiModelInfo.php | 108 + .../V1/ProcessorVersion/ModelType.php | 64 + .../DocumentAI/V1/ProcessorVersion/State.php | 106 + .../DocumentAI/V1/ProcessorVersionAlias.php | 101 + .../Cloud/DocumentAI/V1/RawDocument.php | 155 ++ .../V1/ReviewDocumentOperationMetadata.php | 113 + .../DocumentAI/V1/ReviewDocumentRequest.php | 247 ++ .../V1/ReviewDocumentRequest/Priority.php | 62 + .../DocumentAI/V1/ReviewDocumentResponse.php | 141 + .../V1/ReviewDocumentResponse/State.php | 64 + .../V1/SetDefaultProcessorVersionMetadata.php | 79 + .../V1/SetDefaultProcessorVersionRequest.php | 123 + .../V1/SetDefaultProcessorVersionResponse.php | 35 + .../V1/TrainProcessorVersionMetadata.php | 165 ++ .../DatasetValidation.php | 189 ++ .../V1/TrainProcessorVersionRequest.php | 348 +++ .../CustomDocumentExtractionOptions.php | 71 + .../TrainingMethod.php | 59 + .../FoundationModelTuningOptions.php | 116 + .../InputData.php | 125 + .../V1/TrainProcessorVersionResponse.php | 68 + .../V1/UndeployProcessorVersionMetadata.php | 79 + .../V1/UndeployProcessorVersionRequest.php | 83 + .../V1/UndeployProcessorVersionResponse.php | 35 + .../src/Google/Cloud/DocumentAI/V1/Vertex.php | 102 + .../batch_process_documents.php | 88 + .../create_processor.php | 80 + .../delete_processor.php | 85 + .../delete_processor_version.php | 86 + .../deploy_processor_version.php | 88 + .../disable_processor.php | 87 + .../enable_processor.php | 87 + .../evaluate_processor_version.php | 92 + .../fetch_processor_types.php | 74 + .../get_evaluation.php | 79 + .../get_location.php | 57 + .../get_processor.php | 75 + .../get_processor_type.php | 75 + .../get_processor_version.php | 76 + .../list_evaluations.php | 84 + .../list_locations.php | 62 + .../list_processor_types.php | 77 + .../list_processor_versions.php | 82 + .../list_processors.php | 77 + .../process_document.php | 79 + .../review_document.php | 90 + .../set_default_processor_version.php | 107 + .../train_processor_version.php | 94 + .../undeploy_processor_version.php | 88 + .../Client/DocumentProcessorServiceClient.php | 1075 ++++++++ .../src/V1/DocumentProcessorServiceClient.php | 34 + .../DocumentProcessorServiceGapicClient.php | 2123 ++++++++++++++ .../DocumentAi/v1/src/V1/gapic_metadata.json | 138 + ...ument_processor_service_client_config.json | 168 ++ ...nt_processor_service_descriptor_config.php | 443 +++ ...t_processor_service_rest_client_config.php | 389 +++ .../DocumentProcessorServiceClientTest.php | 2437 +++++++++++++++++ .../V1/DocumentProcessorServiceClientTest.php | 2251 +++++++++++++++ 204 files changed, 36033 insertions(+) create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Barcode.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Document.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentIo.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentProcessorService.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentSchema.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Evaluation.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Geometry.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/OperationMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Processor.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/ProcessorType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Barcode.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchDocumentsInputConfig.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/IndividualProcessStatus.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/State.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BoundingPoly.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata/State.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CreateProcessorRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity/NormalizedValue.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/EntityRelation.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Block.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedBarcode.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedLanguage.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Dimension.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/FormField.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Image.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores/DetectedDefect.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout/Orientation.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Line.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Matrix.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Paragraph.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Symbol.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableCell.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableRow.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak/Type.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/StyleInfo.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/VisualElement.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef/LayoutType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/OperationType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/PBParent.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision/HumanReview.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ShardInfo.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style/FontSize.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor/TextSegment.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextChange.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/EnumValues.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property/OccurrenceType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/Metadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/ConfidenceLevelMetrics.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Counters.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Metrics.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluationReference.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocument.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocuments.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsPrefix.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetEvaluationRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorTypeRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorVersionRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus/State.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/NormalizedVertex.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/Hints.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/PremiumFeatures.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/IndividualPageSelector.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor/State.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType/LocationInfo.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/DeprecationInfo.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/ModelType.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/State.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersionAlias.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/RawDocument.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentOperationMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest/Priority.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse/State.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata/DatasetValidation.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/InputData.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionMetadata.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionRequest.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionResponse.php create mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Vertex.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/create_processor.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor_version.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/disable_processor.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/enable_processor.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_evaluation.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_location.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_type.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_version.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_evaluations.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_locations.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_types.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processors.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/process_document.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/review_document.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/train_processor_version.php create mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php create mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/Client/DocumentProcessorServiceClient.php create mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/DocumentProcessorServiceClient.php create mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/Gapic/DocumentProcessorServiceGapicClient.php create mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_client_config.json create mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_descriptor_config.php create mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_rest_client_config.php create mode 100644 owl-bot-staging/DocumentAi/v1/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php create mode 100644 owl-bot-staging/DocumentAi/v1/tests/Unit/V1/DocumentProcessorServiceClientTest.php diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Barcode.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Barcode.php new file mode 100644 index 000000000000..fc1bf55a7ae2 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Barcode.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' + +(google/cloud/documentai/v1/barcode.protogoogle.cloud.documentai.v1"B +Barcode +format (  + value_format (  + raw_value ( B +com.google.cloud.documentai.v1B BarcodeProtoPZ>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipbGoogle.Cloud.DocumentAI.V1Google\\Cloud\\DocumentAI\\V1Google::Cloud::DocumentAI::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Document.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Document.php new file mode 100644 index 0000000000000000000000000000000000000000..152f7b5e639f008facefe03c4ed44df177e352e0 GIT binary patch literal 13032 zcmd^GPi!Ms8Lyq#v7htDJKgP?0gAh=+AOpVn=PgFc3bS&N!(3h*KxA_V`&)M&&f1n zkC_?oZh&4vTsU)q0}`m>))NOVhyxOE;m8FEA%R2>TtPxeeBbxp%-C5sj5pp>_p+Hc z@B7|+-=E+2=Z#-~b8tLh&t|uHpWC|2JK5H0);;Fgfo-`~+cLAQVYkceY}@J$43pcr zY_?R*?o}Jva;egI21p%iXt#Mjdt_NhCSPlt*08hIvD(8P@4LFOcJGG&lq0T;_4OWi z26~%kw`#>*?&=-g)tg(ypt*qznkAn>^YF$k#@eRtI9YF$eTQY?-(c7>jds>?br=47 z&TurNZ@7kT8sCPK+|G7&)8Rn;@Z9dO-*yeFpGAUdzs*;#X9Z83``o~Sli$vITdJWj zKoHGJ-{p2+H=8Byv~6SHT6PVl=JQ9~^+kvytJmeS$j<0ySH&Ll`G+=nJL}p*KDv4~ zYjbyK_ixd@k->-lU(E>uD-4Y0roqilkss^#49m{vgHr`eCXr5%b+f43ZL7mC#$=0I zJ?`44;ko!SZWv%3uHGAjr>zg#&3!O}p%b2_aXR454a=NHTtrg>H<@x7Byr(bQvS9h*C!A`PEyG;jbT`4pSAAnc(|dvatJ!4NLp!&kim5rm zfn0zCxqCO%)pOXigxLv*P|sWNNZOX1`X$MfumzlS4JAzmBqv;z6YN2I4aUJr&b)BJ z6xIOiEL*;KN>b1Zz$Pxo<=NK!aa?K=vmRuLb=4|UH-t$%=`4p z220_P=D4ROcQUc;+-hq5%Q5p;Ir>R$ua_O>nS4adkm{a`0wl$RIPlKdHtJ`(BOO`*U{w>O4 zWUop|8ob_bAA@+&l~U{BRa_u4R1aYSxm;@9R}VT{jsl1BB1^aQ_Q{bAd+TUoHoD>D z*>IFDc(Hb$8%M{|L&4oy;GE!_=)+gp3XOGm+k&JFln-8qFE&|{I5?2sfG^=f;nYZS z$!)^w`#_39B|crfXPBqpPQYA!o+bPVi)^0OK+#1Ncp5^QM1n}Fzq!ul$+3Y8LW0&G z_F7zsIi|e9Vnz=}GfT9+a8gHhxeAhj?wD)qeWz>LJ2Q~~A+-ko>mLo_kPe_TVsJkExk{49j%1;{ z$>J^3YM*#`K82u*NT+NuHqdST$kqqP9;#0vqnbwx_#QKjz7Ou

|%j17vs**E#`J zNmQTWAPuBbYHS4%a;TdcH#ycE4&X70_v_)sdq@n*f}Xadw=h<+DWU@%seyFLHu{&{ z)4G_IJDC)5nL@amKuj6EQeX?tX|H9OPG*s~OksihM5r{_CEo&NlI3Jph}mo5CFB{P ztPYg-*k$r_?OPyuh|`(_SOpRj!R7VvjLGfa7EJbu2brdA-Q#@#aGps|10+5fCN1i# zEE)Ln5{un8I_@#WgQ&91;>QArF{KJXj?yRyOfi8+D?#doV7Leg)=18Uq)El+jI^;4 z&X|P7Q~(hPO8}&{b>E>K#1K{?WH^LR^yH^;^n^7rrE!bupQ9`;@nkl!4WbStlwG64 zQNlt1Z?dHp#xbLRqzxaV+TR>37hmo>q!P1Ds^|Ew!^wt)OMJXr`D&4lq7ypIb)fp{yf5##wAdL z8XYTkgqY>^;)TSSYXGNf8*Co`S1z-3O*}^-4#c<0(9GY~1$^kYt$%d6JmXJ3U9@I%MY_C0kYp+E|zYijzJ%v&r(icv(4~ zWeDthq%5Ps68_1zp_9T*$aEvqRvpAbh;RcqsK0~Ug~sq{q&k1pWG&4SpbkVW(I$u~ zFai!QMnpRQm_)7qeU2rALJ#^LR4r znjijy&c%gYRDtV+3~g@``-@vJgb=}<&_*=WRHi^>X^Sq*2|v}ay(W8VUtpJmcajp{ zVtXwKz4Otm8>7$kNrn1@2wU+p0CCMR1KWL>Ey!|S=4H>G2TihWS8ublw-vvabcHQ> z3Wg?TN0?s{gYnrSQT=U%DHAGo;4sz)AOnsnoTYse>hLbeAFEyL&D=R}uj4u7!^`;z zWr=vI>ulLOlNiA)gVc|>F!>;VjI+4BVW`ZaT})Rpbo+vt9R)cYiYlLDi`bNcMx?Mh z>Mw}dR~hqO8J*D^8+b7yd9>lEpn$Copn<5#&Ng<1L)#-}xX(K}c4eWj26-VZp#Cb#R?h5Sxz18_n>Plje&3TyI&x>iX9!x8|2h8gh5;h+10hceRHqg|+9W2w>iP!zyzu?;(iip0B)g3WWd>JdXoHmCk+4th<# zb1878MJ{Udu9xtHZ$yjZQte#lUG=|F=xG6K_#1VAd`XCNsDmg*(v(RTbK(XV_cKjB zIlfv>G_V?Aro!DaEGfBz?gVVbG7)s2(%Dv_u-?$ELc#yjQ106ILHWUEur>e)L$?p=-$wNg)VT8y)0Ph_`v-*`t-Mp- zg-&8RMz0ISopL&kZNtrKeOH5);!Y{Opnin9^|1rWYp_#s9ZPzMQNLiBkQ9Y4p10Tn z+^hiRdujeFo|m3`WgDym`bTo87(^69=`OE_Y`gfo%~b(!sTGSVRbOLq$(For^c2{@ z78Wfs-ZKZf1~u!_7&GN*rdDg^x@f~r(8>avE0jv06X-A0%e&RXGAIQ8KB$!njdFSc zo3-_FZ3mkYbJ#v8AA(Bi<+l&Y`wi&k&a2S`qVy7t7izUSuqdTtG<=yY((wMBO05Q? zaU4~D7G(+l)_aA;z*peDn3@iNU{8Wq+EyFBiGd4YN(y0+k>b1@Aug0g35rl8Ob}xL zUgFz@Bp`RH4Q(s{dHnW++#bk)vd*ymB=0=A zZRCJY{JwgVrA8i6clc3@m$ZS*=uw099mEU5wqk|K-*b3!i<4pX|B?M2p0Z>0qu_wo;iJO6* zYzMXQ_LQWWTE9D^MLp<+=tPTwZCa3&V*fxB>xo?Aof)r(3wR5{`Aoxc<$40pXMDaL z;O{L5AVen%@&ZE!PAbMldUH72^I|C7hf-gCg)Iw}dm~uuV049Vq#)u8Y{ymrjX}UC zeaF=AK_Mptlcy>wHQ+%eH(uc(93U`KVf-^Q(*HzQT5iPGp>i_buM&PSV-fm29neg!cFUno}bi z@|{cRu|@J^h<|XE>LsBwmI*Fbh6PUjTANH>{lN2(V8Y`PP!aCB2t(9=$Jol5Ps<<= zkJG1W-uc7by`JHcqi6L;&{d|ts6B|^um!M{fkKGBfEUO~sRH^#a&H~gdnVoe_yBR}8JjX~>H@OIGpMO59QA8q6|@JAbdK2@mX z4sZP4d)bsf>F|HkQK&TGM;)I;zbJ_Fd7{qez1Ea literal 0 HcmV?d00001 diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentIo.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentIo.php new file mode 100644 index 0000000000000000000000000000000000000000..0da52cce58e734b3ad3a45c723f227d6f76e65eb GIT binary patch literal 2208 zcmb7F-EJF26pj;;#>YubR{>lD?ZhdHBg#fL;$}liOd%HbSLH6OTD$EW|iq`(7YYf8Q5g z8nQ@HzJJjw{<&P(#xX!dLndSDG15KjJZ6geRMA1#_!vCWJ_g5ykHLBC0Kf~Vlq9$I z1pER7KXEz?xJRU-3cv1g>GFsxP6PfkrgKO}G>{D8FW()dk*Bzbhz9f{k2Uv5=2PFj z7Yj`PkmRJ!v?8d+pcg5YL^K#2GwCHfRw6mWtBx~fs?bqentQXb+8rN}X2#KRULtu& zRFbmA=!7IprAc&Pcxwlj#jn8?k`?SuI1Bv8R6cW@d0KNXCacdL@L3K=zF$y2!S`(z zL3GGn_+ta^zs;OEMX)5+fvx}FtA>91G#rgoMF}RF=4g zg;8tOdJi_U198EUfW{_|)y^hVd?po-aBzvJ@y`mB`(84u4+mB!*raln^QYI*FHrWW zhFIHhn?-aOFzgw{FPIzqBR8grL{&@&ty??r;p_?zk+b__it|!UUFnI0$=W-p*}C-+ zY*GJ$;$ZY$;U%t!HBnhx#day{tY$9cG#rYcwq`(gz|y-SRm_!YiX3<}618=G)>*EV ztUcJqjyCK(RFrx+Ox>Y)j=K3wF*A^BU|jX#UF?sLr=dGy6sI9FtKdnc{l%NffeoY4 zCo^#UF05t>Vb2CM8mBt-OlCa-%5?$N7ckaf7w+bHvLNG!)tEe6psP!4-Kt-ic_t;+ z#>`1b)kLd_Dr!moD#0Dp>zaHz)x11=!c6(I()SOtD$d812=~XL*s{2DY0MYaF6Hs? zz%RCGJp6sR-Zh)nHk-Dn|D&FL-ug2?9L)A`v51d)1Kh-aFMphY9mk*@C+Bz6bDZW3@R?jlh#7!60# z)a1-`W@xWs2>C^eAVpu&<{?P>hZF?@6hR&e6bbT@KBVwN&?Z10Tol*{)tOvx|ko!dhW`E2&+x-zjxWwcpbW zSJ6w4ZhN0(;HqklW7@K#*^hKpE7E-sGL)X?Sc<9@7Mryd%~d*zt86S%mK*bg<;H@? za^u16IfT@%;y4BIZBuY=F~;Z#D!_kMf3vHr1;-Xk#$3Nb)~C+5p=y<*iyQV z2F!-nZuJe-)lH*72-XZ$yLzp_c#^eOEE8;Vw;)7>?OhX0wb3wK%{G+o#)9Ukwr;tm z-Grr;%C_cuMke1}y~ejC?DVa|RVHJlG9={Pf@}A+;O>Qjt+{>Mn4@wN27BJWHX;mI zwe*duVVJ}Urr}g7zD_=iIKug^4hK0J%{^V~c52#=@<=!B(MZ=d?og?PjBpRnS<>&F z#HC>#4WE{}qxF=-@v1*kx_x?%hvTzmk$?wx5Ycuxc3%7)5u5g|rKM-JY#Q5k-!ODz zd&5&~1V8t}7lNnWv)tYETYIF`=T{Wx;Q?sdI>4W+^sMx>>z2CFf`IPFs7Vp(=36?) zqiUz)!OuMa@~a+T5cqfv{pLe7cL)T>c}85M@L%-dzxe2Oews5@EFIDVK@$f1`IiF^ zwg_a%n;bLvf(wBKHU|d&=o)`SH}o=0IN$K4H&QH>b(62Ym1ea=BbifNPoU7eaOI0% zPgrb}Hn zOWD?-oakyQLgs3&TrDzjquj9==2mQYteU{7#ThMq44*}4%Qky5h-14m$AR%U ze2dWp{Z=zNGau*Q-9gAyZCN#qEq!|?Lq&KcNrW}ko~Mg(3%$@)cFn#ks3$4)n@Q9I z3M^B4#;-Q^Q8j~?&`IW?viV4}ZM~z-Oi;G7No++a#j+ITl>d1Koe1*B9duIN=^GCL zX@$g0-+M`{6C^Iqb9Mm*^6#Um@Yi@63O=$>cA#>jCLU+HzKSmBhT83SG+BWv%>gHn zcQmB~0y;BU(0YPtas!=@K5017apFS`a2>nKxYkY}ME%NEjBQQ&yJMaYu4{kRhfVO? z=%j9RbwiT{*3BHFCcctn2Vr9HqqorsTY2nLGsoR{Es17R43JTREx@lD8 z%6TEQ#nGYYB||)qPQtgO>X%Ixzcg%eudlDKt)Dt3{Y?g)^rJC!rlz>+jwc+8*jQ&@C82Bq0t?X{ zo<%;Dv@zX6#FEn>3^=4W(Rsm124E+gRhAh@4#|~oC9xG8*C-+97#WTPZYGWk9yDV|WUo`ReL?eR-KYK1Lq% z&+vF0BXs;;wXqEUJ}!M8tG9cgLYZ-K5S$Evf#z&_DK8+?> z4NfXE;wj@$QnB*MH6LmQ&quo`A0@@nDGD{>NkjY4Wj6x0H4$f0dVuly{LtcS~%<7P_@Th6{UC8 zCOQ*jE!f@(vE>#-X)FjONCmi}wx%U0Q&;*VQ~v;v`3B za|68;y@g0pcp0vcX0K-&UYCQSXD+!qo~I;Ub5C#s00ot-uDSdCR4NdaqPJj2CsC!N zRtPbVSZNi#eBbEA$i&Ls!$*&V3h|q8#jW@?&q?*a&Y<)2v^et)TsZHc(EKiBF#*Oj zi{;Acu$Wvbvr-G4A8>mi)gkb48%+-|O)@I0sS>Z4aX|#q*9~Q}>*K-^NPhuM4>9F# z1BwkidQOV9!GgMT)SBhd%rIB3+RpH^=cL<@Gw2g7&0Wy8lz!Jw`2&dlR?x4>oqV!3 zN{+_&(S;7%Auzq=*@<-`Y6nTpSCEt>J2$4Cv?|H0tod-DSor=Vda-RQy5Zr=fJOg2 zgCw;NjmDnWF_59`v=urp_PSgw96v}(+)3LM=jj%rA5ix;;9YQNA$~c7UfweM23$O$ zRG_V_uI%>76wH(21iiW4Kd=<{JpL=tDeJZ=cVC1U$W2xLK~6mFL9QrxIP{KG?@$CL zO>a>e%B=eh%|dc*O>8s@`v#ic_;U#Hh7i1jz}vdD16z=`h8BPm>posa=QkBciwGvt zzn!Fu^8b=SlO7#@A7St=nAyX*3Kd0j?0`M06*T3-T|K~#^(+p?F8}}FiTn5~@z#@` z8a>V3F+22TI91+0uxa+er`5RQMbGGP>AauQo`VKwhc0m(~^rx}?wn zU0GYGFUz$mX^CdwYCF}guQZoQLzR7(&CBS;q&R^VOO9#|qa@8@Qwcu3cm>ULHN~b! zOWwbcdjRFS1w&Gs8YfHrp>{gh2H5H<+m2L0m#8koD8;ao^zetHizWc+_hT`{&j(Vm zg)UP4sRKhKIGQU%CtYX2#Y6tRk-b1jTO`p1JRf*0aTiT9{~q3rj4^WMquee3&(QlH zmf=NoRz#}|Q#fegr~sxeJ=bx35uE|`sVRaFNf?gf>j5mIPsKejss%TTrb3*EgOMRg z#9HaE#?U!7pb)?(3cW)Qw4gl@>f!UAH!C?_r?>Z;=(@1Ta9=Di{@`uz0-DiiRm$-^ z=re2>wTvb#8(uNe-Cf$VpDI_9yeLw0m=`e)q?azl6B&ec>_^BT(q%N^F@zrELj7L# z{&E}UEzniGzrI*sZJ!E`js6R+GlOFB0ETwfU{94A6EBM9H|cIol|Ma-%8WPd-fE=v zYioZBgL6_oz@5r5MYC>hpH}M$G_hWPw?5ydm>6oWW~Hw~HVEr9bZw8i4;8Q!ex@b_Uh$%{(>w1 zi!2iJSFr{s0u|@L&m(_5Njh&W(@*+N=2?}#EAZ7{{qMK3f0>cqAn)})A#V@dg(`z! zh*O#^bxoDtMaaM5Yxb@$eAuh-PnFEuFrf}pHJd)3Vr-DV>1712Av8{NyxW2v9mF_TBtF?%&;1C zTp@R=Xs1F$#N&U4OTl0-E{KUy+vfKQBK@h$Z|_B1Kf_g%dCn{{ql0ctm_fGP*?&2m_7Onv&iRp6~*$ zQO(kx@UU9s)PIv17-tKelTSSqUxGv^btiS0`IJ1`TH$CDIwpd)uUPcy;V);0<|*Rb z5=9*tmv9=P`@%^x2OrChKhI}6GYLZ zG{N733EtUn+(~Q^wTB7pX;;2$u=KEloh4^Ww zhkda#(1NGD6vnxTTiRE;=(;{@EVNsTeD2Zv~a$M{~Ht=7lbE1a(@ z&})yGIujfHeHKlH+keT0e|T+5Tl@rUaVNHQx?lV8Sv9IxP2EG4zCcY9(aTO_oD!vD zDzP^9Ud5(=5g@t}#6&-bEXEr^L#@f=EEY$V(rmwASuCClE9&sR&BkZd;pq~!Ur*Wz zyOgNyQ(4b*L{Vl!!CTQ-XKlz*#FEhDeF2Jft`M{vapLRsp{2rRDf@Ji90dP$+#Crg z{Sfk1D{;+0Yci3+W+_buiyJgzF+7HIiOYkOP0_N88 zBI>GoQ}iQw1GSm?>|3l4A^uhnUe4Y&gMUg2q6L1vK+&zuIbVEh^9R}dBK?Je;yn3< zf}*!qqxj(VQ}J+v|9*k@H|f>J2K<7-Z?l&eaiv13D;1x-Qi12yFO4=WYeMX>KI{|z zuf0G&_K9fC2JXsEiL7Kz+Pz`m`fYUuNxr^=C$h|Yz3{So%AGfl!$Q}5{Wb4zk8iM_ aHVFI@0{MdjU5)q^1iF&_TEQOLL+Fn)6;O+#=$J$#!GZ*6 zJVWA=pg7@z`<$V1HkptF`8qrNIFr9FjD~K0(L*qf;VqfCU~MYn)L>;f%T^&gi1G58yML zrl?qbrs3cRK=K!7V@7?H3M}N`Lz;RtqJm;Zzn8~4KoiVTA|Y~o~CH%(TlUo24z1R4C6<`7NOV}V$ z7J65hWs+e{1Alr8;OAJ9Y!+T7Ld|7@|E%?zK7^#L0W|M9?VbKV?pCivRbBAlM+0ihOXgefMz7O39}Jwcj^ho#>O0=~*|WaW zai6+Qck7P14flHeq1!uapLjhPvt^jC!gjfIdVVr=`zOv;MMVyrFV5Y8)6FASRAjkS zMy?*!U^CYs_r}Ig22_h4Ghc`8VvIaFDO5-o(Q{HY--Dg<6K0Hm>xCH;G-kwOcuZKT z^{krj!u>cQ6Z#zq)R@s|>hZ{1>I|bZS4Hm@arfrtx^cIGuX=xzae+R&QymFNeGB zS{JR~ijSlDMNr-ZZFeNEfX+CN8W`8_eg^|%(n#V zlJhGfE*SBASGd%*$$8l8F`rO(;BlMzIw7?a^7N!l>a}Kj15E=r^eHn)-*x*ot5Dkw zyOpj>!vS-I#VeP)6?SRap(VKM=n5CWu?8&gEXqiub$HB#)wP7xX())!k%Z{fQi#sk z?mhsutso%v6bfDd!JikN+nka>AU-8qJTSS#1-ESe17>qTdX^n9G#}UPg$|W55ovJZ zP`158B21~f<++&s0ZD>t$%0@pI!#9~-?8jYjRn-_o^bsZsv1V0iL{LJWP2xeE8%#L zY)3H~##oRCMED^a^-hS-MCd#FDsBldOusr4N>=rF=aj{*FtUU)`$<-5PHm3u5Z1sm zCfcf6eEg8dnOD2rG||UMitRKs8R!G}O@j~Lf(=?ZQq~o9^o%f*mDN)cXkWleQW2B7p=^5)2UbbUCNyg_ z)1%l-`xaI$+ct3);H_jqTDU2d=fMr(jze4UBiHHiuIz47$1hoTgV7!CjUSK2BpJRbz+b9QB_63$4PXdl38a(aoyKu$%{St%|5l!Li6;XCjycf3%T zNeP3fhN>9_?JnHr4h}Ki9aE5uENJVn*0b-Q z@O(zOj9G<{*Op)gPp~VB3VCfA=6btkKwY1eq>sFI58g+kE~oe+m@cKEuP#-RiSnY| zhxNXXZSI;ly~M=?J;~*QMxc~|B}IvA0!jnjy@K?bQc)>k3*?kEJvTrmT_TkfHA}KV z1r4jNCjFRLc4$QG$m=^|J(q}uD=d4gCG%2T4qz?g-V=7o?4-ISSf(i}OeTBwQFc^Lg{s{=>^EC3vknWbxm3f)~|CAkE!UM{ZBWGP_RPJr!fza z2KWl`f!sq(U1QqU1Fb7UI5`;>u$s$&aPI z<_!nNB@k{Py_2=9TAHg9$7vC`| zg362dYgn;es-9UqOFoAclu{N1t{-Ve-y_Fo(HI?-n(=5Ijx3BQkEb2Zui@dJImyhy z8@hG4T8kIQD$icTR_>dJ(TkNl)cCgd-O)W2pL|?ZlhI>w?|gss&#(D%L#?N}T2J-V zOH)7F{XG$O;^j5nUaQRxuCFiicOqlMP}YW#nH$F0?)i**g+F0a5qti2wiq literal 0 HcmV?d00001 diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Geometry.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Geometry.php new file mode 100644 index 000000000000..2780ed666e20 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Geometry.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile( + ' + +)google/cloud/documentai/v1/geometry.protogoogle.cloud.documentai.v1" +Vertex +x ( +y ("( +NormalizedVertex +x ( +y (" + BoundingPoly4 +vertices ( 2".google.cloud.documentai.v1.VertexI +normalized_vertices ( 2,.google.cloud.documentai.v1.NormalizedVertexB +com.google.cloud.documentai.v1B GeometryProtoPZ>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipbGoogle.Cloud.DocumentAI.V1Google\\Cloud\\DocumentAI\\V1Google::Cloud::DocumentAI::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/OperationMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/OperationMetadata.php new file mode 100644 index 0000000000000000000000000000000000000000..5152d9893a80987d5815419964ae6281b52ffedc GIT binary patch literal 1280 zcmbVL(QeZ)6s6rdn5Ru65>QP7nK5ad1gW|`;jy7E%}S)vRQUp##quZ9DRZEnnDqC$q5hO zD4k4b3<(bf3utUZ*y_SgcL3d%H+ZR_2~T4}5u9>94QQPNJRR4^oTMR*Bxd!SMx6^y z&UiEosl;O}v2FMPh;T>~feD4}-r2|5qu(}EzN4x9Rzc-oHI4xw0ZtOw%_(yb_y(Z* zL^=u>fr(W42;5`IkVQ-~9I&sdxf3|SK|&SFa_l6Hh^`T8KsO?^b^tR@9lIyE65|Bs zwe_?j~I2 zOlkp>1W#$TtQgm=ZSW|j*#cK9=B5rdNK6%ED3x^86?M6BxRWO~TdSsS7rI&skP5ZZ zGr;P<0J{`a@|qs^2hD*yyzKOQuH&71ZfpC2wE-S}y6kkkPJ6p#Z2{mkJC1vCq0eP& z6Rh_y9mjQBDt5&JVC}r=U8w(6{WJ?z$I98S5_q9Zn^%5^^k+|(6gPX*D}6rA!gINK zSfBDmPh-K9t>=RjqvOTHkMd62SlBiewsQ+NJ^QNhGk^4F1}_}m^n7LUKjr5c7$Jj3 lXbwl{sxewKQ#jf$mh*Mymj!$2Su=8nwM=BT|F_^4fWNNpn%MvV literal 0 HcmV?d00001 diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Processor.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Processor.php new file mode 100644 index 0000000000000000000000000000000000000000..d03f0e9f91701831a7bb57798030f0691a323952 GIT binary patch literal 4080 zcmb_f&2HO95RPQaw#JSvvrZu^Ny|6^;{24V-J%EO50pi@Dq=~nWdUx4vNXA}x1mUa zq+BGad+MP;Z!M5(?|q7%d+QtYoJZ)Xv%4fE%Zh6w$-&Wbc4lY3oo{CL;S=xBgPZau zafok(#FF=4$l)Q8J>Lyo)3xROez!|}*>rmzwTZ9Da-|{H8!cI@)LJ)CHE{dBNlNm8 z>mJyoXxeVyDq61D?-3_7Xz^&Rh{jA31g@`evjC3KBY|g_MBZ$cw@7GMMrd?4xrNRK zv(Tv|7CP;<2LPsR1cBU)Ex{|0@t@b_GR@>bSyJRyYi~=u~a(c*hEas% zr%-i%ef=!eQCF26rpa8Kkcu#C`UICc3o<{=9Vx`tVg!^VOQf%0(Z=mTs1I<<&v3P3 ztTyI4l|hnj6D*MgYY4;Vc`wkPlL((In#oGnU@883B(N3e0heBdd4ZDNGaTc9SovA} zJ|m)OL(U?ePfX4RtZrR5f0_IC@GRd>0aO_nsi6(20nl?TV(Z}xkK`B7;{5s-7qYm; z)LW=694)}*0DTO)lmxo>GRWr!L5#>~esLgs28##8(G98#e|UrvkMO~T{6QA0lsm-& zACa+Tihyyd;H?H~T^8 z_QssdVw_!XzRSrQ-1g|Hg=dg|n@>^!q%L)^Av)AK&<)#mzekQR6lSEGaJ5GrJ@gIy zYa9E-CYBzb+o)A*S|xW$%EMAy+uo@)>RLswHg@Y3 zwS|jZN}30#*6Nzx+C@<=U7m}J03+SXZz;&|Ix1a(#hsSg8Z|rzGZn4*w6TZEDd{p~ z#i~}{%%z!aJSi4WNDD90fGJf(%~DGz|FWOpV1Pf#|Y#*kgNQ63O>Rnd&WhUKZu7;l_tsF zOnv=W%y;pyijDff9e%@N|HfzRAO>&$!SLdbbYYXfT^0VANhVvhrnJ}oiiMr%Wt+T| z)LIAMwr|qcg>tFHwM(VM$6Be>UfZ8SSVH%++sVV^zIZSWy)W6|OwBQGOTJUQ0FU7q F;6G$kE>!>k literal 0 HcmV?d00001 diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/ProcessorType.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/ProcessorType.php new file mode 100644 index 000000000000..65a61c15c025 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/ProcessorType.php @@ -0,0 +1,40 @@ +internalAddGeneratedFile( + ' + +/google/cloud/documentai/v1/processor_type.protogoogle.cloud.documentai.v1google/api/resource.proto" + ProcessorType +name (  +type (  +category ( S +available_locations ( 26.google.cloud.documentai.v1.ProcessorType.LocationInfo +allow_creation (- + launch_stage (2.google.api.LaunchStage +sample_document_uris ( # + LocationInfo + location_id ( :uAr +\'documentai.googleapis.com/ProcessorTypeGprojects/{project}/locations/{location}/processorTypes/{processor_type}B +com.google.cloud.documentai.v1BDocumentAiProcessorTypePZ>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipbGoogle.Cloud.DocumentAI.V1Google\\Cloud\\DocumentAI\\V1Google::Cloud::DocumentAI::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Barcode.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Barcode.php new file mode 100644 index 000000000000..c07863d95b65 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Barcode.php @@ -0,0 +1,255 @@ +google.cloud.documentai.v1.Barcode + */ +class Barcode extends \Google\Protobuf\Internal\Message +{ + /** + * Format of a barcode. + * The supported formats are: + * - `CODE_128`: Code 128 type. + * - `CODE_39`: Code 39 type. + * - `CODE_93`: Code 93 type. + * - `CODABAR`: Codabar type. + * - `DATA_MATRIX`: 2D Data Matrix type. + * - `ITF`: ITF type. + * - `EAN_13`: EAN-13 type. + * - `EAN_8`: EAN-8 type. + * - `QR_CODE`: 2D QR code type. + * - `UPC_A`: UPC-A type. + * - `UPC_E`: UPC-E type. + * - `PDF417`: PDF417 type. + * - `AZTEC`: 2D Aztec code type. + * - `DATABAR`: GS1 DataBar code type. + * + * Generated from protobuf field string format = 1; + */ + protected $format = ''; + /** + * Value format describes the format of the value that a barcode + * encodes. + * The supported formats are: + * - `CONTACT_INFO`: Contact information. + * - `EMAIL`: Email address. + * - `ISBN`: ISBN identifier. + * - `PHONE`: Phone number. + * - `PRODUCT`: Product. + * - `SMS`: SMS message. + * - `TEXT`: Text string. + * - `URL`: URL address. + * - `WIFI`: Wifi information. + * - `GEO`: Geo-localization. + * - `CALENDAR_EVENT`: Calendar event. + * - `DRIVER_LICENSE`: Driver's license. + * + * Generated from protobuf field string value_format = 2; + */ + protected $value_format = ''; + /** + * Raw value encoded in the barcode. + * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + * + * Generated from protobuf field string raw_value = 3; + */ + protected $raw_value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $format + * Format of a barcode. + * The supported formats are: + * - `CODE_128`: Code 128 type. + * - `CODE_39`: Code 39 type. + * - `CODE_93`: Code 93 type. + * - `CODABAR`: Codabar type. + * - `DATA_MATRIX`: 2D Data Matrix type. + * - `ITF`: ITF type. + * - `EAN_13`: EAN-13 type. + * - `EAN_8`: EAN-8 type. + * - `QR_CODE`: 2D QR code type. + * - `UPC_A`: UPC-A type. + * - `UPC_E`: UPC-E type. + * - `PDF417`: PDF417 type. + * - `AZTEC`: 2D Aztec code type. + * - `DATABAR`: GS1 DataBar code type. + * @type string $value_format + * Value format describes the format of the value that a barcode + * encodes. + * The supported formats are: + * - `CONTACT_INFO`: Contact information. + * - `EMAIL`: Email address. + * - `ISBN`: ISBN identifier. + * - `PHONE`: Phone number. + * - `PRODUCT`: Product. + * - `SMS`: SMS message. + * - `TEXT`: Text string. + * - `URL`: URL address. + * - `WIFI`: Wifi information. + * - `GEO`: Geo-localization. + * - `CALENDAR_EVENT`: Calendar event. + * - `DRIVER_LICENSE`: Driver's license. + * @type string $raw_value + * Raw value encoded in the barcode. + * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Barcode::initOnce(); + parent::__construct($data); + } + + /** + * Format of a barcode. + * The supported formats are: + * - `CODE_128`: Code 128 type. + * - `CODE_39`: Code 39 type. + * - `CODE_93`: Code 93 type. + * - `CODABAR`: Codabar type. + * - `DATA_MATRIX`: 2D Data Matrix type. + * - `ITF`: ITF type. + * - `EAN_13`: EAN-13 type. + * - `EAN_8`: EAN-8 type. + * - `QR_CODE`: 2D QR code type. + * - `UPC_A`: UPC-A type. + * - `UPC_E`: UPC-E type. + * - `PDF417`: PDF417 type. + * - `AZTEC`: 2D Aztec code type. + * - `DATABAR`: GS1 DataBar code type. + * + * Generated from protobuf field string format = 1; + * @return string + */ + public function getFormat() + { + return $this->format; + } + + /** + * Format of a barcode. + * The supported formats are: + * - `CODE_128`: Code 128 type. + * - `CODE_39`: Code 39 type. + * - `CODE_93`: Code 93 type. + * - `CODABAR`: Codabar type. + * - `DATA_MATRIX`: 2D Data Matrix type. + * - `ITF`: ITF type. + * - `EAN_13`: EAN-13 type. + * - `EAN_8`: EAN-8 type. + * - `QR_CODE`: 2D QR code type. + * - `UPC_A`: UPC-A type. + * - `UPC_E`: UPC-E type. + * - `PDF417`: PDF417 type. + * - `AZTEC`: 2D Aztec code type. + * - `DATABAR`: GS1 DataBar code type. + * + * Generated from protobuf field string format = 1; + * @param string $var + * @return $this + */ + public function setFormat($var) + { + GPBUtil::checkString($var, True); + $this->format = $var; + + return $this; + } + + /** + * Value format describes the format of the value that a barcode + * encodes. + * The supported formats are: + * - `CONTACT_INFO`: Contact information. + * - `EMAIL`: Email address. + * - `ISBN`: ISBN identifier. + * - `PHONE`: Phone number. + * - `PRODUCT`: Product. + * - `SMS`: SMS message. + * - `TEXT`: Text string. + * - `URL`: URL address. + * - `WIFI`: Wifi information. + * - `GEO`: Geo-localization. + * - `CALENDAR_EVENT`: Calendar event. + * - `DRIVER_LICENSE`: Driver's license. + * + * Generated from protobuf field string value_format = 2; + * @return string + */ + public function getValueFormat() + { + return $this->value_format; + } + + /** + * Value format describes the format of the value that a barcode + * encodes. + * The supported formats are: + * - `CONTACT_INFO`: Contact information. + * - `EMAIL`: Email address. + * - `ISBN`: ISBN identifier. + * - `PHONE`: Phone number. + * - `PRODUCT`: Product. + * - `SMS`: SMS message. + * - `TEXT`: Text string. + * - `URL`: URL address. + * - `WIFI`: Wifi information. + * - `GEO`: Geo-localization. + * - `CALENDAR_EVENT`: Calendar event. + * - `DRIVER_LICENSE`: Driver's license. + * + * Generated from protobuf field string value_format = 2; + * @param string $var + * @return $this + */ + public function setValueFormat($var) + { + GPBUtil::checkString($var, True); + $this->value_format = $var; + + return $this; + } + + /** + * Raw value encoded in the barcode. + * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + * + * Generated from protobuf field string raw_value = 3; + * @return string + */ + public function getRawValue() + { + return $this->raw_value; + } + + /** + * Raw value encoded in the barcode. + * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. + * + * Generated from protobuf field string raw_value = 3; + * @param string $var + * @return $this + */ + public function setRawValue($var) + { + GPBUtil::checkString($var, True); + $this->raw_value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchDocumentsInputConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchDocumentsInputConfig.php new file mode 100644 index 000000000000..087665129f05 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchDocumentsInputConfig.php @@ -0,0 +1,108 @@ +google.cloud.documentai.v1.BatchDocumentsInputConfig + */ +class BatchDocumentsInputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\GcsPrefix $gcs_prefix + * The set of documents that match the specified Cloud Storage `gcs_prefix`. + * @type \Google\Cloud\DocumentAI\V1\GcsDocuments $gcs_documents + * The set of documents individually specified on Cloud Storage. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * The set of documents that match the specified Cloud Storage `gcs_prefix`. + * + * Generated from protobuf field .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + * @return \Google\Cloud\DocumentAI\V1\GcsPrefix|null + */ + public function getGcsPrefix() + { + return $this->readOneof(1); + } + + public function hasGcsPrefix() + { + return $this->hasOneof(1); + } + + /** + * The set of documents that match the specified Cloud Storage `gcs_prefix`. + * + * Generated from protobuf field .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; + * @param \Google\Cloud\DocumentAI\V1\GcsPrefix $var + * @return $this + */ + public function setGcsPrefix($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\GcsPrefix::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The set of documents individually specified on Cloud Storage. + * + * Generated from protobuf field .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + * @return \Google\Cloud\DocumentAI\V1\GcsDocuments|null + */ + public function getGcsDocuments() + { + return $this->readOneof(2); + } + + public function hasGcsDocuments() + { + return $this->hasOneof(2); + } + + /** + * The set of documents individually specified on Cloud Storage. + * + * Generated from protobuf field .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; + * @param \Google\Cloud\DocumentAI\V1\GcsDocuments $var + * @return $this + */ + public function setGcsDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\GcsDocuments::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata.php new file mode 100644 index 000000000000..acda6f101347 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata.php @@ -0,0 +1,228 @@ +google.cloud.documentai.v1.BatchProcessMetadata + */ +class BatchProcessMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The state of the current batch processing. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + */ + protected $state = 0; + /** + * A message providing more details about the current state of processing. + * For example, the error message if the operation is failed. + * + * Generated from protobuf field string state_message = 2; + */ + protected $state_message = ''; + /** + * The creation time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * The last update time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + /** + * The list of response details of each document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + */ + private $individual_process_statuses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The state of the current batch processing. + * @type string $state_message + * A message providing more details about the current state of processing. + * For example, the error message if the operation is failed. + * @type \Google\Protobuf\Timestamp $create_time + * The creation time of the operation. + * @type \Google\Protobuf\Timestamp $update_time + * The last update time of the operation. + * @type array<\Google\Cloud\DocumentAI\V1\BatchProcessMetadata\IndividualProcessStatus>|\Google\Protobuf\Internal\RepeatedField $individual_process_statuses + * The list of response details of each document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The state of the current batch processing. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the current batch processing. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\BatchProcessMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * A message providing more details about the current state of processing. + * For example, the error message if the operation is failed. + * + * Generated from protobuf field string state_message = 2; + * @return string + */ + public function getStateMessage() + { + return $this->state_message; + } + + /** + * A message providing more details about the current state of processing. + * For example, the error message if the operation is failed. + * + * Generated from protobuf field string state_message = 2; + * @param string $var + * @return $this + */ + public function setStateMessage($var) + { + GPBUtil::checkString($var, True); + $this->state_message = $var; + + return $this; + } + + /** + * The creation time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The creation time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The last update time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The last update time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The list of response details of each document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndividualProcessStatuses() + { + return $this->individual_process_statuses; + } + + /** + * The list of response details of each document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; + * @param array<\Google\Cloud\DocumentAI\V1\BatchProcessMetadata\IndividualProcessStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndividualProcessStatuses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\BatchProcessMetadata\IndividualProcessStatus::class); + $this->individual_process_statuses = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/IndividualProcessStatus.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/IndividualProcessStatus.php new file mode 100644 index 000000000000..9b8d8d2c539b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/IndividualProcessStatus.php @@ -0,0 +1,208 @@ +google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + */ +class IndividualProcessStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The source of the document, same as the + * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + * field in the request when the batch process started. + * + * Generated from protobuf field string input_gcs_source = 1; + */ + protected $input_gcs_source = ''; + /** + * The status processing the document. + * + * Generated from protobuf field .google.rpc.Status status = 2; + */ + protected $status = null; + /** + * The Cloud Storage output destination (in the request as + * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + * of the processed document if it was successful, otherwise empty. + * + * Generated from protobuf field string output_gcs_destination = 3; + */ + protected $output_gcs_destination = ''; + /** + * The status of human review on the processed document. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + */ + protected $human_review_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $input_gcs_source + * The source of the document, same as the + * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + * field in the request when the batch process started. + * @type \Google\Rpc\Status $status + * The status processing the document. + * @type string $output_gcs_destination + * The Cloud Storage output destination (in the request as + * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + * of the processed document if it was successful, otherwise empty. + * @type \Google\Cloud\DocumentAI\V1\HumanReviewStatus $human_review_status + * The status of human review on the processed document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The source of the document, same as the + * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + * field in the request when the batch process started. + * + * Generated from protobuf field string input_gcs_source = 1; + * @return string + */ + public function getInputGcsSource() + { + return $this->input_gcs_source; + } + + /** + * The source of the document, same as the + * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] + * field in the request when the batch process started. + * + * Generated from protobuf field string input_gcs_source = 1; + * @param string $var + * @return $this + */ + public function setInputGcsSource($var) + { + GPBUtil::checkString($var, True); + $this->input_gcs_source = $var; + + return $this; + } + + /** + * The status processing the document. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status processing the document. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + + /** + * The Cloud Storage output destination (in the request as + * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + * of the processed document if it was successful, otherwise empty. + * + * Generated from protobuf field string output_gcs_destination = 3; + * @return string + */ + public function getOutputGcsDestination() + { + return $this->output_gcs_destination; + } + + /** + * The Cloud Storage output destination (in the request as + * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + * of the processed document if it was successful, otherwise empty. + * + * Generated from protobuf field string output_gcs_destination = 3; + * @param string $var + * @return $this + */ + public function setOutputGcsDestination($var) + { + GPBUtil::checkString($var, True); + $this->output_gcs_destination = $var; + + return $this; + } + + /** + * The status of human review on the processed document. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + * @return \Google\Cloud\DocumentAI\V1\HumanReviewStatus|null + */ + public function getHumanReviewStatus() + { + return $this->human_review_status; + } + + public function hasHumanReviewStatus() + { + return isset($this->human_review_status); + } + + public function clearHumanReviewStatus() + { + unset($this->human_review_status); + } + + /** + * The status of human review on the processed document. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; + * @param \Google\Cloud\DocumentAI\V1\HumanReviewStatus $var + * @return $this + */ + public function setHumanReviewStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\HumanReviewStatus::class); + $this->human_review_status = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IndividualProcessStatus::class, \Google\Cloud\DocumentAI\V1\BatchProcessMetadata_IndividualProcessStatus::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/State.php new file mode 100644 index 000000000000..2271791e75f1 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/State.php @@ -0,0 +1,92 @@ +google.cloud.documentai.v1.BatchProcessMetadata.State + */ +class State +{ + /** + * The default value. This value is used if the state is omitted. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Request operation is waiting for scheduling. + * + * Generated from protobuf enum WAITING = 1; + */ + const WAITING = 1; + /** + * Request is being processed. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The batch processing completed successfully. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * The batch processing was being cancelled. + * + * Generated from protobuf enum CANCELLING = 4; + */ + const CANCELLING = 4; + /** + * The batch processing was cancelled. + * + * Generated from protobuf enum CANCELLED = 5; + */ + const CANCELLED = 5; + /** + * The batch processing has failed. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::WAITING => 'WAITING', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::CANCELLING => 'CANCELLING', + self::CANCELLED => 'CANCELLED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\DocumentAI\V1\BatchProcessMetadata_State::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessRequest.php new file mode 100644 index 000000000000..51031e244a22 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessRequest.php @@ -0,0 +1,342 @@ +google.cloud.documentai.v1.BatchProcessRequest + */ +class BatchProcessRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The input documents for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + */ + protected $input_documents = null; + /** + * The output configuration for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + */ + protected $document_output_config = null; + /** + * Whether human review should be skipped for this request. Default to + * `false`. + * + * Generated from protobuf field bool skip_human_review = 4; + */ + protected $skip_human_review = false; + /** + * Inference-time options for the process API + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + protected $process_options = null; + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * @param string $name Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * @return \Google\Cloud\DocumentAI\V1\BatchProcessRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $input_documents + * The input documents for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * @type \Google\Cloud\DocumentAI\V1\DocumentOutputConfig $document_output_config + * The output configuration for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * @type bool $skip_human_review + * Whether human review should be skipped for this request. Default to + * `false`. + * @type \Google\Cloud\DocumentAI\V1\ProcessOptions $process_options + * Inference-time options for the process API + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The input documents for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null + */ + public function getInputDocuments() + { + return $this->input_documents; + } + + public function hasInputDocuments() + { + return isset($this->input_documents); + } + + public function clearInputDocuments() + { + unset($this->input_documents); + } + + /** + * The input documents for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; + * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var + * @return $this + */ + public function setInputDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig::class); + $this->input_documents = $var; + + return $this; + } + + /** + * The output configuration for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + * @return \Google\Cloud\DocumentAI\V1\DocumentOutputConfig|null + */ + public function getDocumentOutputConfig() + { + return $this->document_output_config; + } + + public function hasDocumentOutputConfig() + { + return isset($this->document_output_config); + } + + public function clearDocumentOutputConfig() + { + unset($this->document_output_config); + } + + /** + * The output configuration for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; + * @param \Google\Cloud\DocumentAI\V1\DocumentOutputConfig $var + * @return $this + */ + public function setDocumentOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig::class); + $this->document_output_config = $var; + + return $this; + } + + /** + * Whether human review should be skipped for this request. Default to + * `false`. + * + * Generated from protobuf field bool skip_human_review = 4; + * @return bool + */ + public function getSkipHumanReview() + { + return $this->skip_human_review; + } + + /** + * Whether human review should be skipped for this request. Default to + * `false`. + * + * Generated from protobuf field bool skip_human_review = 4; + * @param bool $var + * @return $this + */ + public function setSkipHumanReview($var) + { + GPBUtil::checkBool($var); + $this->skip_human_review = $var; + + return $this; + } + + /** + * Inference-time options for the process API + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * @return \Google\Cloud\DocumentAI\V1\ProcessOptions|null + */ + public function getProcessOptions() + { + return $this->process_options; + } + + public function hasProcessOptions() + { + return isset($this->process_options); + } + + public function clearProcessOptions() + { + unset($this->process_options); + } + + /** + * Inference-time options for the process API + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * @param \Google\Cloud\DocumentAI\V1\ProcessOptions $var + * @return $this + */ + public function setProcessOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions::class); + $this->process_options = $var; + + return $this; + } + + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessResponse.php new file mode 100644 index 000000000000..57562ab5f73f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessResponse.php @@ -0,0 +1,34 @@ +google.cloud.documentai.v1.BatchProcessResponse + */ +class BatchProcessResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BoundingPoly.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BoundingPoly.php new file mode 100644 index 000000000000..90a2873a1327 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BoundingPoly.php @@ -0,0 +1,101 @@ +google.cloud.documentai.v1.BoundingPoly + */ +class BoundingPoly extends \Google\Protobuf\Internal\Message +{ + /** + * The bounding polygon vertices. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Vertex vertices = 1; + */ + private $vertices; + /** + * The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + */ + private $normalized_vertices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Vertex>|\Google\Protobuf\Internal\RepeatedField $vertices + * The bounding polygon vertices. + * @type array<\Google\Cloud\DocumentAI\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $normalized_vertices + * The bounding polygon normalized vertices. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Geometry::initOnce(); + parent::__construct($data); + } + + /** + * The bounding polygon vertices. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Vertex vertices = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVertices() + { + return $this->vertices; + } + + /** + * The bounding polygon vertices. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Vertex vertices = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Vertex>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVertices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Vertex::class); + $this->vertices = $arr; + + return $this; + } + + /** + * The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNormalizedVertices() + { + return $this->normalized_vertices; + } + + /** + * The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; + * @param array<\Google\Cloud\DocumentAI\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNormalizedVertices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\NormalizedVertex::class); + $this->normalized_vertices = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata.php new file mode 100644 index 000000000000..e5406876c1ca --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata.php @@ -0,0 +1,223 @@ +google.cloud.documentai.v1.CommonOperationMetadata + */ +class CommonOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The state of the operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + */ + protected $state = 0; + /** + * A message providing more details about the current state of processing. + * + * Generated from protobuf field string state_message = 2; + */ + protected $state_message = ''; + /** + * A related resource to this operation. + * + * Generated from protobuf field string resource = 5; + */ + protected $resource = ''; + /** + * The creation time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * The last update time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The state of the operation. + * @type string $state_message + * A message providing more details about the current state of processing. + * @type string $resource + * A related resource to this operation. + * @type \Google\Protobuf\Timestamp $create_time + * The creation time of the operation. + * @type \Google\Protobuf\Timestamp $update_time + * The last update time of the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\OperationMetadata::initOnce(); + parent::__construct($data); + } + + /** + * The state of the operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * A message providing more details about the current state of processing. + * + * Generated from protobuf field string state_message = 2; + * @return string + */ + public function getStateMessage() + { + return $this->state_message; + } + + /** + * A message providing more details about the current state of processing. + * + * Generated from protobuf field string state_message = 2; + * @param string $var + * @return $this + */ + public function setStateMessage($var) + { + GPBUtil::checkString($var, True); + $this->state_message = $var; + + return $this; + } + + /** + * A related resource to this operation. + * + * Generated from protobuf field string resource = 5; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * A related resource to this operation. + * + * Generated from protobuf field string resource = 5; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The creation time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The creation time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The last update time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The last update time of the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata/State.php new file mode 100644 index 000000000000..59ee91f8b60e --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata/State.php @@ -0,0 +1,85 @@ +google.cloud.documentai.v1.CommonOperationMetadata.State + */ +class State +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Operation is still running. + * + * Generated from protobuf enum RUNNING = 1; + */ + const RUNNING = 1; + /** + * Operation is being cancelled. + * + * Generated from protobuf enum CANCELLING = 2; + */ + const CANCELLING = 2; + /** + * Operation succeeded. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * Operation failed. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * Operation is cancelled. + * + * Generated from protobuf enum CANCELLED = 5; + */ + const CANCELLED = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::RUNNING => 'RUNNING', + self::CANCELLING => 'CANCELLING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::CANCELLED => 'CANCELLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata_State::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CreateProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CreateProcessorRequest.php new file mode 100644 index 000000000000..64faa44770ca --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CreateProcessorRequest.php @@ -0,0 +1,161 @@ +google.cloud.documentai.v1.CreateProcessorRequest + */ +class CreateProcessorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * field must be set if the processor is under CMEK. + * + * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $processor = null; + + /** + * @param string $parent Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * Please see {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\DocumentAI\V1\Processor $processor Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * field must be set if the processor is under CMEK. + * + * @return \Google\Cloud\DocumentAI\V1\CreateProcessorRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DocumentAI\V1\Processor $processor): self + { + return (new self()) + ->setParent($parent) + ->setProcessor($processor); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * @type \Google\Cloud\DocumentAI\V1\Processor $processor + * Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * field must be set if the processor is under CMEK. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * field must be set if the processor is under CMEK. + * + * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DocumentAI\V1\Processor|null + */ + public function getProcessor() + { + return $this->processor; + } + + public function hasProcessor() + { + return isset($this->processor); + } + + public function clearProcessor() + { + unset($this->processor); + } + + /** + * Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * field must be set if the processor is under CMEK. + * + * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DocumentAI\V1\Processor $var + * @return $this + */ + public function setProcessor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Processor::class); + $this->processor = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorMetadata.php new file mode 100644 index 000000000000..80124ed069c0 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorMetadata.php @@ -0,0 +1,79 @@ +google.cloud.documentai.v1.DeleteProcessorMetadata + */ +class DeleteProcessorMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + protected $common_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorRequest.php new file mode 100644 index 000000000000..6cb572b012b4 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorRequest.php @@ -0,0 +1,83 @@ +google.cloud.documentai.v1.DeleteProcessorRequest + */ +class DeleteProcessorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor resource name to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The processor resource name to be deleted. Please see + * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\DeleteProcessorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor resource name to be deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor resource name to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor resource name to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionMetadata.php new file mode 100644 index 000000000000..4327a21261df --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionMetadata.php @@ -0,0 +1,79 @@ +google.cloud.documentai.v1.DeleteProcessorVersionMetadata + */ +class DeleteProcessorVersionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + protected $common_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionRequest.php new file mode 100644 index 000000000000..c1b9fe66983a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionRequest.php @@ -0,0 +1,83 @@ +google.cloud.documentai.v1.DeleteProcessorVersionRequest + */ +class DeleteProcessorVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor version resource name to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The processor version resource name to be deleted. Please see + * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\DeleteProcessorVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor version resource name to be deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor version resource name to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor version resource name to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionMetadata.php new file mode 100644 index 000000000000..58dbc80516ee --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionMetadata.php @@ -0,0 +1,79 @@ +google.cloud.documentai.v1.DeployProcessorVersionMetadata + */ +class DeployProcessorVersionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + protected $common_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionRequest.php new file mode 100644 index 000000000000..38bd51702394 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionRequest.php @@ -0,0 +1,83 @@ +google.cloud.documentai.v1.DeployProcessorVersionRequest + */ +class DeployProcessorVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor version resource name to be deployed. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The processor version resource name to be deployed. Please see + * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\DeployProcessorVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor version resource name to be deployed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor version resource name to be deployed. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor version resource name to be deployed. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionResponse.php new file mode 100644 index 000000000000..f44a4454de41 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionResponse.php @@ -0,0 +1,35 @@ +google.cloud.documentai.v1.DeployProcessorVersionResponse + */ +class DeployProcessorVersionResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorMetadata.php new file mode 100644 index 000000000000..dbecdbea0c9e --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorMetadata.php @@ -0,0 +1,79 @@ +google.cloud.documentai.v1.DisableProcessorMetadata + */ +class DisableProcessorMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + protected $common_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorRequest.php new file mode 100644 index 000000000000..fcefe5486fe9 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorRequest.php @@ -0,0 +1,69 @@ +google.cloud.documentai.v1.DisableProcessorRequest + */ +class DisableProcessorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor resource name to be disabled. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor resource name to be disabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor resource name to be disabled. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor resource name to be disabled. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorResponse.php new file mode 100644 index 000000000000..f1f15d776735 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorResponse.php @@ -0,0 +1,35 @@ +google.cloud.documentai.v1.DisableProcessorResponse + */ +class DisableProcessorResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document.php new file mode 100644 index 000000000000..7dc35121eda2 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document.php @@ -0,0 +1,611 @@ +google.cloud.documentai.v1.Document + */ +class Document extends \Google\Protobuf\Internal\Message +{ + /** + * An IANA published [media type (MIME + * type)](https://www.iana.org/assignments/media-types/media-types.xhtml). + * + * Generated from protobuf field string mime_type = 3; + */ + protected $mime_type = ''; + /** + * Optional. UTF-8 encoded text in reading order from the document. + * + * Generated from protobuf field string text = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + /** + * Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true]; + * @deprecated + */ + private $text_styles; + /** + * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page pages = 6; + */ + private $pages; + /** + * A list of entities detected on + * [Document.text][google.cloud.documentai.v1.Document.text]. For document + * shards, entities in this list may cross shard boundaries. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; + */ + private $entities; + /** + * Placeholder. Relationship among + * [Document.entities][google.cloud.documentai.v1.Document.entities]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; + */ + private $entity_relations; + /** + * Placeholder. A list of text corrections made to + * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + * used for annotating corrections to OCR mistakes. Text changes for a given + * revision may not overlap with each other. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; + */ + private $text_changes; + /** + * Information about the sharding if this document is sharded part of a larger + * document. If the document is not sharded, this message is not specified. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ShardInfo shard_info = 9; + */ + protected $shard_info = null; + /** + * Any error that occurred while processing this document. + * + * Generated from protobuf field .google.rpc.Status error = 10; + */ + protected $error = null; + /** + * Placeholder. Revision history of this document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; + */ + private $revisions; + /** + * Parsed layout of the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; + */ + protected $document_layout = null; + /** + * Document chunked based on chunking config. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; + */ + protected $chunked_document = null; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Optional. Currently supports Google Cloud Storage URI of the form + * `gs://bucket_name/object_name`. Object versioning is not supported. + * For more information, refer to [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris). + * @type string $content + * Optional. Inline document content, represented as a stream of bytes. + * Note: As with all `bytes` fields, protobuffers use a pure binary + * representation, whereas JSON representations use base64. + * @type string $mime_type + * An IANA published [media type (MIME + * type)](https://www.iana.org/assignments/media-types/media-types.xhtml). + * @type string $text + * Optional. UTF-8 encoded text in reading order from the document. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Style>|\Google\Protobuf\Internal\RepeatedField $text_styles + * Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page>|\Google\Protobuf\Internal\RepeatedField $pages + * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $entities + * A list of entities detected on + * [Document.text][google.cloud.documentai.v1.Document.text]. For document + * shards, entities in this list may cross shard boundaries. + * @type array<\Google\Cloud\DocumentAI\V1\Document\EntityRelation>|\Google\Protobuf\Internal\RepeatedField $entity_relations + * Placeholder. Relationship among + * [Document.entities][google.cloud.documentai.v1.Document.entities]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\TextChange>|\Google\Protobuf\Internal\RepeatedField $text_changes + * Placeholder. A list of text corrections made to + * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + * used for annotating corrections to OCR mistakes. Text changes for a given + * revision may not overlap with each other. + * @type \Google\Cloud\DocumentAI\V1\Document\ShardInfo $shard_info + * Information about the sharding if this document is sharded part of a larger + * document. If the document is not sharded, this message is not specified. + * @type \Google\Rpc\Status $error + * Any error that occurred while processing this document. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Revision>|\Google\Protobuf\Internal\RepeatedField $revisions + * Placeholder. Revision history of this document. + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout $document_layout + * Parsed layout of the document. + * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument $chunked_document + * Document chunked based on chunking config. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Currently supports Google Cloud Storage URI of the form + * `gs://bucket_name/object_name`. Object versioning is not supported. + * For more information, refer to [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris). + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUri() + { + return $this->readOneof(1); + } + + public function hasUri() + { + return $this->hasOneof(1); + } + + /** + * Optional. Currently supports Google Cloud Storage URI of the form + * `gs://bucket_name/object_name`. Object versioning is not supported. + * For more information, refer to [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris). + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Inline document content, represented as a stream of bytes. + * Note: As with all `bytes` fields, protobuffers use a pure binary + * representation, whereas JSON representations use base64. + * + * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getContent() + { + return $this->readOneof(2); + } + + public function hasContent() + { + return $this->hasOneof(2); + } + + /** + * Optional. Inline document content, represented as a stream of bytes. + * Note: As with all `bytes` fields, protobuffers use a pure binary + * representation, whereas JSON representations use base64. + * + * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * An IANA published [media type (MIME + * type)](https://www.iana.org/assignments/media-types/media-types.xhtml). + * + * Generated from protobuf field string mime_type = 3; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * An IANA published [media type (MIME + * type)](https://www.iana.org/assignments/media-types/media-types.xhtml). + * + * Generated from protobuf field string mime_type = 3; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Optional. UTF-8 encoded text in reading order from the document. + * + * Generated from protobuf field string text = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. UTF-8 encoded text in reading order from the document. + * + * Generated from protobuf field string text = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getTextStyles() + { + @trigger_error('text_styles is deprecated.', E_USER_DEPRECATED); + return $this->text_styles; + } + + /** + * Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true]; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Style>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setTextStyles($var) + { + @trigger_error('text_styles is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Style::class); + $this->text_styles = $arr; + + return $this; + } + + /** + * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page pages = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPages() + { + return $this->pages; + } + + /** + * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page pages = 6; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page::class); + $this->pages = $arr; + + return $this; + } + + /** + * A list of entities detected on + * [Document.text][google.cloud.documentai.v1.Document.text]. For document + * shards, entities in this list may cross shard boundaries. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntities() + { + return $this->entities; + } + + /** + * A list of entities detected on + * [Document.text][google.cloud.documentai.v1.Document.text]. For document + * shards, entities in this list may cross shard boundaries. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Entity::class); + $this->entities = $arr; + + return $this; + } + + /** + * Placeholder. Relationship among + * [Document.entities][google.cloud.documentai.v1.Document.entities]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntityRelations() + { + return $this->entity_relations; + } + + /** + * Placeholder. Relationship among + * [Document.entities][google.cloud.documentai.v1.Document.entities]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; + * @param array<\Google\Cloud\DocumentAI\V1\Document\EntityRelation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntityRelations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\EntityRelation::class); + $this->entity_relations = $arr; + + return $this; + } + + /** + * Placeholder. A list of text corrections made to + * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + * used for annotating corrections to OCR mistakes. Text changes for a given + * revision may not overlap with each other. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTextChanges() + { + return $this->text_changes; + } + + /** + * Placeholder. A list of text corrections made to + * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually + * used for annotating corrections to OCR mistakes. Text changes for a given + * revision may not overlap with each other. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; + * @param array<\Google\Cloud\DocumentAI\V1\Document\TextChange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTextChanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\TextChange::class); + $this->text_changes = $arr; + + return $this; + } + + /** + * Information about the sharding if this document is sharded part of a larger + * document. If the document is not sharded, this message is not specified. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ShardInfo shard_info = 9; + * @return \Google\Cloud\DocumentAI\V1\Document\ShardInfo|null + */ + public function getShardInfo() + { + return $this->shard_info; + } + + public function hasShardInfo() + { + return isset($this->shard_info); + } + + public function clearShardInfo() + { + unset($this->shard_info); + } + + /** + * Information about the sharding if this document is sharded part of a larger + * document. If the document is not sharded, this message is not specified. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ShardInfo shard_info = 9; + * @param \Google\Cloud\DocumentAI\V1\Document\ShardInfo $var + * @return $this + */ + public function setShardInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ShardInfo::class); + $this->shard_info = $var; + + return $this; + } + + /** + * Any error that occurred while processing this document. + * + * Generated from protobuf field .google.rpc.Status error = 10; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Any error that occurred while processing this document. + * + * Generated from protobuf field .google.rpc.Status error = 10; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + + /** + * Placeholder. Revision history of this document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRevisions() + { + return $this->revisions; + } + + /** + * Placeholder. Revision history of this document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Revision>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRevisions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Revision::class); + $this->revisions = $arr; + + return $this; + } + + /** + * Parsed layout of the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout|null + */ + public function getDocumentLayout() + { + return $this->document_layout; + } + + public function hasDocumentLayout() + { + return isset($this->document_layout); + } + + public function clearDocumentLayout() + { + unset($this->document_layout); + } + + /** + * Parsed layout of the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout $var + * @return $this + */ + public function setDocumentLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout::class); + $this->document_layout = $var; + + return $this; + } + + /** + * Document chunked based on chunking config. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; + * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument|null + */ + public function getChunkedDocument() + { + return $this->chunked_document; + } + + public function hasChunkedDocument() + { + return isset($this->chunked_document); + } + + public function clearChunkedDocument() + { + unset($this->chunked_document); + } + + /** + * Document chunked based on chunking config. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; + * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument $var + * @return $this + */ + public function setChunkedDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument::class); + $this->chunked_document = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument.php new file mode 100644 index 000000000000..a99c77df458d --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument.php @@ -0,0 +1,70 @@ +google.cloud.documentai.v1.Document.ChunkedDocument + */ +class ChunkedDocument extends \Google\Protobuf\Internal\Message +{ + /** + * List of chunks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; + */ + private $chunks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk>|\Google\Protobuf\Internal\RepeatedField $chunks + * List of chunks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * List of chunks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChunks() + { + return $this->chunks; + } + + /** + * List of chunks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChunks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk::class); + $this->chunks = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ChunkedDocument::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk.php new file mode 100644 index 000000000000..e94f373bcc29 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk.php @@ -0,0 +1,250 @@ +google.cloud.documentai.v1.Document.ChunkedDocument.Chunk + */ +class Chunk extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the chunk. + * + * Generated from protobuf field string chunk_id = 1; + */ + protected $chunk_id = ''; + /** + * Unused. + * + * Generated from protobuf field repeated string source_block_ids = 2; + */ + private $source_block_ids; + /** + * Text content of the chunk. + * + * Generated from protobuf field string content = 3; + */ + protected $content = ''; + /** + * Page span of the chunk. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; + */ + protected $page_span = null; + /** + * Page headers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; + */ + private $page_headers; + /** + * Page footers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; + */ + private $page_footers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $chunk_id + * ID of the chunk. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_block_ids + * Unused. + * @type string $content + * Text content of the chunk. + * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span + * Page span of the chunk. + * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader>|\Google\Protobuf\Internal\RepeatedField $page_headers + * Page headers associated with the chunk. + * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter>|\Google\Protobuf\Internal\RepeatedField $page_footers + * Page footers associated with the chunk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * ID of the chunk. + * + * Generated from protobuf field string chunk_id = 1; + * @return string + */ + public function getChunkId() + { + return $this->chunk_id; + } + + /** + * ID of the chunk. + * + * Generated from protobuf field string chunk_id = 1; + * @param string $var + * @return $this + */ + public function setChunkId($var) + { + GPBUtil::checkString($var, True); + $this->chunk_id = $var; + + return $this; + } + + /** + * Unused. + * + * Generated from protobuf field repeated string source_block_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceBlockIds() + { + return $this->source_block_ids; + } + + /** + * Unused. + * + * Generated from protobuf field repeated string source_block_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceBlockIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_block_ids = $arr; + + return $this; + } + + /** + * Text content of the chunk. + * + * Generated from protobuf field string content = 3; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Text content of the chunk. + * + * Generated from protobuf field string content = 3; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Page span of the chunk. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; + * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null + */ + public function getPageSpan() + { + return $this->page_span; + } + + public function hasPageSpan() + { + return isset($this->page_span); + } + + public function clearPageSpan() + { + unset($this->page_span); + } + + /** + * Page span of the chunk. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; + * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var + * @return $this + */ + public function setPageSpan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); + $this->page_span = $var; + + return $this; + } + + /** + * Page headers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageHeaders() + { + return $this->page_headers; + } + + /** + * Page headers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; + * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader::class); + $this->page_headers = $arr; + + return $this; + } + + /** + * Page footers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageFooters() + { + return $this->page_footers; + } + + /** + * Page footers associated with the chunk. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; + * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageFooters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter::class); + $this->page_footers = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Chunk::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument_Chunk::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php new file mode 100644 index 000000000000..45bcf4550676 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php @@ -0,0 +1,114 @@ +google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter + */ +class ChunkPageFooter extends \Google\Protobuf\Internal\Message +{ + /** + * Footer in text format. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * Page span of the footer. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + */ + protected $page_span = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Footer in text format. + * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span + * Page span of the footer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Footer in text format. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Footer in text format. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Page span of the footer. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null + */ + public function getPageSpan() + { + return $this->page_span; + } + + public function hasPageSpan() + { + return isset($this->page_span); + } + + public function clearPageSpan() + { + unset($this->page_span); + } + + /** + * Page span of the footer. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var + * @return $this + */ + public function setPageSpan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); + $this->page_span = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ChunkPageFooter::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument_Chunk_ChunkPageFooter::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php new file mode 100644 index 000000000000..b6020d329863 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php @@ -0,0 +1,114 @@ +google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader + */ +class ChunkPageHeader extends \Google\Protobuf\Internal\Message +{ + /** + * Header in text format. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * Page span of the header. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + */ + protected $page_span = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Header in text format. + * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span + * Page span of the header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Header in text format. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Header in text format. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Page span of the header. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null + */ + public function getPageSpan() + { + return $this->page_span; + } + + public function hasPageSpan() + { + return isset($this->page_span); + } + + public function clearPageSpan() + { + unset($this->page_span); + } + + /** + * Page span of the header. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var + * @return $this + */ + public function setPageSpan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); + $this->page_span = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ChunkPageHeader::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument_Chunk_ChunkPageHeader::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php new file mode 100644 index 000000000000..42705efd01b5 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php @@ -0,0 +1,104 @@ +google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan + */ +class ChunkPageSpan extends \Google\Protobuf\Internal\Message +{ + /** + * Page where chunk starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + */ + protected $page_start = 0; + /** + * Page where chunk ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + */ + protected $page_end = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_start + * Page where chunk starts in the document. + * @type int $page_end + * Page where chunk ends in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Page where chunk starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + * @return int + */ + public function getPageStart() + { + return $this->page_start; + } + + /** + * Page where chunk starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + * @param int $var + * @return $this + */ + public function setPageStart($var) + { + GPBUtil::checkInt32($var); + $this->page_start = $var; + + return $this; + } + + /** + * Page where chunk ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + * @return int + */ + public function getPageEnd() + { + return $this->page_end; + } + + /** + * Page where chunk ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + * @param int $var + * @return $this + */ + public function setPageEnd($var) + { + GPBUtil::checkInt32($var); + $this->page_end = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ChunkPageSpan::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument_Chunk_ChunkPageSpan::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout.php new file mode 100644 index 000000000000..9314561734fc --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout.php @@ -0,0 +1,71 @@ +google.cloud.documentai.v1.Document.DocumentLayout + */ +class DocumentLayout extends \Google\Protobuf\Internal\Message +{ + /** + * List of blocks in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + */ + private $blocks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks + * List of blocks in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * List of blocks in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * List of blocks in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); + $this->blocks = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DocumentLayout::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock.php new file mode 100644 index 000000000000..a7ccddccad7c --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock.php @@ -0,0 +1,223 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock + */ +class DocumentLayoutBlock extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the block. + * + * Generated from protobuf field string block_id = 1; + */ + protected $block_id = ''; + /** + * Page span of the block. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; + */ + protected $page_span = null; + protected $block; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock $text_block + * Block consisting of text content. + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock $table_block + * Block consisting of table content/structure. + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock $list_block + * Block consisting of list content/structure. + * @type string $block_id + * ID of the block. + * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan $page_span + * Page span of the block. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Block consisting of text content. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock text_block = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock|null + */ + public function getTextBlock() + { + return $this->readOneof(2); + } + + public function hasTextBlock() + { + return $this->hasOneof(2); + } + + /** + * Block consisting of text content. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock text_block = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock $var + * @return $this + */ + public function setTextBlock($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Block consisting of table content/structure. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock table_block = 3; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock|null + */ + public function getTableBlock() + { + return $this->readOneof(3); + } + + public function hasTableBlock() + { + return $this->hasOneof(3); + } + + /** + * Block consisting of table content/structure. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock table_block = 3; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock $var + * @return $this + */ + public function setTableBlock($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Block consisting of list content/structure. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock list_block = 4; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock|null + */ + public function getListBlock() + { + return $this->readOneof(4); + } + + public function hasListBlock() + { + return $this->hasOneof(4); + } + + /** + * Block consisting of list content/structure. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock list_block = 4; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock $var + * @return $this + */ + public function setListBlock($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * ID of the block. + * + * Generated from protobuf field string block_id = 1; + * @return string + */ + public function getBlockId() + { + return $this->block_id; + } + + /** + * ID of the block. + * + * Generated from protobuf field string block_id = 1; + * @param string $var + * @return $this + */ + public function setBlockId($var) + { + GPBUtil::checkString($var, True); + $this->block_id = $var; + + return $this; + } + + /** + * Page span of the block. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; + * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan|null + */ + public function getPageSpan() + { + return $this->page_span; + } + + public function hasPageSpan() + { + return isset($this->page_span); + } + + public function clearPageSpan() + { + unset($this->page_span); + } + + /** + * Page span of the block. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; + * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan $var + * @return $this + */ + public function setPageSpan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan::class); + $this->page_span = $var; + + return $this; + } + + /** + * @return string + */ + public function getBlock() + { + return $this->whichOneof("block"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DocumentLayoutBlock::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php new file mode 100644 index 000000000000..6c384415c569 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php @@ -0,0 +1,108 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + */ +class LayoutListBlock extends \Google\Protobuf\Internal\Message +{ + /** + * List entries that constitute a list block. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; + */ + private $list_entries; + /** + * Type of the list_entries (if exist). Available options are `ordered` + * and `unordered`. + * + * Generated from protobuf field string type = 2; + */ + protected $type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry>|\Google\Protobuf\Internal\RepeatedField $list_entries + * List entries that constitute a list block. + * @type string $type + * Type of the list_entries (if exist). Available options are `ordered` + * and `unordered`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * List entries that constitute a list block. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getListEntries() + { + return $this->list_entries; + } + + /** + * List entries that constitute a list block. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setListEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry::class); + $this->list_entries = $arr; + + return $this; + } + + /** + * Type of the list_entries (if exist). Available options are `ordered` + * and `unordered`. + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the list_entries (if exist). Available options are `ordered` + * and `unordered`. + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutListBlock::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutListBlock::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php new file mode 100644 index 000000000000..6cd2da2ccad8 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php @@ -0,0 +1,74 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + */ +class LayoutListEntry extends \Google\Protobuf\Internal\Message +{ + /** + * A list entry is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + */ + private $blocks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks + * A list entry is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * A list entry is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * A list entry is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); + $this->blocks = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutListEntry::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutListEntry::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php new file mode 100644 index 000000000000..98f1c810beb9 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php @@ -0,0 +1,104 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + */ +class LayoutPageSpan extends \Google\Protobuf\Internal\Message +{ + /** + * Page where block starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + */ + protected $page_start = 0; + /** + * Page where block ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + */ + protected $page_end = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_start + * Page where block starts in the document. + * @type int $page_end + * Page where block ends in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Page where block starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + * @return int + */ + public function getPageStart() + { + return $this->page_start; + } + + /** + * Page where block starts in the document. + * + * Generated from protobuf field int32 page_start = 1; + * @param int $var + * @return $this + */ + public function setPageStart($var) + { + GPBUtil::checkInt32($var); + $this->page_start = $var; + + return $this; + } + + /** + * Page where block ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + * @return int + */ + public function getPageEnd() + { + return $this->page_end; + } + + /** + * Page where block ends in the document. + * + * Generated from protobuf field int32 page_end = 2; + * @param int $var + * @return $this + */ + public function setPageEnd($var) + { + GPBUtil::checkInt32($var); + $this->page_end = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutPageSpan::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutPageSpan::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php new file mode 100644 index 000000000000..b3236907b08d --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php @@ -0,0 +1,138 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + */ +class LayoutTableBlock extends \Google\Protobuf\Internal\Message +{ + /** + * Header rows at the top of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; + */ + private $header_rows; + /** + * Body rows containing main table content. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; + */ + private $body_rows; + /** + * Table caption/title. + * + * Generated from protobuf field string caption = 3; + */ + protected $caption = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $header_rows + * Header rows at the top of the table. + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $body_rows + * Body rows containing main table content. + * @type string $caption + * Table caption/title. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Header rows at the top of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaderRows() + { + return $this->header_rows; + } + + /** + * Header rows at the top of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaderRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow::class); + $this->header_rows = $arr; + + return $this; + } + + /** + * Body rows containing main table content. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBodyRows() + { + return $this->body_rows; + } + + /** + * Body rows containing main table content. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBodyRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow::class); + $this->body_rows = $arr; + + return $this; + } + + /** + * Table caption/title. + * + * Generated from protobuf field string caption = 3; + * @return string + */ + public function getCaption() + { + return $this->caption; + } + + /** + * Table caption/title. + * + * Generated from protobuf field string caption = 3; + * @param string $var + * @return $this + */ + public function setCaption($var) + { + GPBUtil::checkString($var, True); + $this->caption = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutTableBlock::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutTableBlock::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php new file mode 100644 index 000000000000..7524382420ad --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php @@ -0,0 +1,142 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + */ +class LayoutTableCell extends \Google\Protobuf\Internal\Message +{ + /** + * A table cell is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + */ + private $blocks; + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + */ + protected $row_span = 0; + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + */ + protected $col_span = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks + * A table cell is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * @type int $row_span + * How many rows this cell spans. + * @type int $col_span + * How many columns this cell spans. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * A table cell is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * A table cell is a list of blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); + $this->blocks = $arr; + + return $this; + } + + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + * @return int + */ + public function getRowSpan() + { + return $this->row_span; + } + + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + * @param int $var + * @return $this + */ + public function setRowSpan($var) + { + GPBUtil::checkInt32($var); + $this->row_span = $var; + + return $this; + } + + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + * @return int + */ + public function getColSpan() + { + return $this->col_span; + } + + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + * @param int $var + * @return $this + */ + public function setColSpan($var) + { + GPBUtil::checkInt32($var); + $this->col_span = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutTableCell::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutTableCell::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php new file mode 100644 index 000000000000..93ace2a1d069 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php @@ -0,0 +1,70 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + */ +class LayoutTableRow extends \Google\Protobuf\Internal\Message +{ + /** + * A table row is a list of table cells. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; + */ + private $cells; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell>|\Google\Protobuf\Internal\RepeatedField $cells + * A table row is a list of table cells. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * A table row is a list of table cells. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCells() + { + return $this->cells; + } + + /** + * A table row is a list of table cells. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCells($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell::class); + $this->cells = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutTableRow::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutTableRow::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php new file mode 100644 index 000000000000..e952d9e11f97 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php @@ -0,0 +1,150 @@ +google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + */ +class LayoutTextBlock extends \Google\Protobuf\Internal\Message +{ + /** + * Text content stored in the block. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * Type of the text in the block. Available options are: `paragraph`, + * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + * `heading-5`, `header`, `footer`. + * + * Generated from protobuf field string type = 2; + */ + protected $type = ''; + /** + * A text block could further have child blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; + */ + private $blocks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Text content stored in the block. + * @type string $type + * Type of the text in the block. Available options are: `paragraph`, + * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + * `heading-5`, `header`, `footer`. + * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks + * A text block could further have child blocks. + * Repeated blocks support further hierarchies and nested blocks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Text content stored in the block. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Text content stored in the block. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Type of the text in the block. Available options are: `paragraph`, + * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + * `heading-5`, `header`, `footer`. + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the text in the block. Available options are: `paragraph`, + * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, + * `heading-5`, `header`, `footer`. + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * A text block could further have child blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * A text block could further have child blocks. + * Repeated blocks support further hierarchies and nested blocks. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; + * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); + $this->blocks = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutTextBlock::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutTextBlock::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity.php new file mode 100644 index 000000000000..b8ace41a89a5 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity.php @@ -0,0 +1,488 @@ +google.cloud.documentai.v1.Document.Entity + */ +class Entity extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Provenance of the entity. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text_anchor = null; + /** + * Required. Entity type from a schema e.g. `Address`. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = ''; + /** + * Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. + * + * Generated from protobuf field string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mention_text = ''; + /** + * Optional. Deprecated. Use `id` field instead. + * + * Generated from protobuf field string mention_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mention_id = ''; + /** + * Optional. Confidence of detected Schema entity. Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confidence = 0.0; + /** + * Optional. Represents the provenance of this entity wrt. the location on + * the page where it was found. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_anchor = null; + /** + * Optional. Canonical id. This will be a unique value in the entity list + * for this document. + * + * Generated from protobuf field string id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $id = ''; + /** + * Optional. Normalized entity value. Absent if the extracted value could + * not be converted or the type (e.g. address) is not supported for certain + * parsers. This field is also only populated for certain supported document + * types. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $normalized_value = null; + /** + * Optional. Entities can be nested to form a hierarchical data structure + * representing the content in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $properties; + /** + * Optional. The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $provenance = null; + /** + * Optional. Whether the entity will be redacted for de-identification + * purposes. + * + * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $redacted = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor + * Optional. Provenance of the entity. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * @type string $type + * Required. Entity type from a schema e.g. `Address`. + * @type string $mention_text + * Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. + * @type string $mention_id + * Optional. Deprecated. Use `id` field instead. + * @type float $confidence + * Optional. Confidence of detected Schema entity. Range `[0, 1]`. + * @type \Google\Cloud\DocumentAI\V1\Document\PageAnchor $page_anchor + * Optional. Represents the provenance of this entity wrt. the location on + * the page where it was found. + * @type string $id + * Optional. Canonical id. This will be a unique value in the entity list + * for this document. + * @type \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue $normalized_value + * Optional. Normalized entity value. Absent if the extracted value could + * not be converted or the type (e.g. address) is not supported for certain + * parsers. This field is also only populated for certain supported document + * types. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $properties + * Optional. Entities can be nested to form a hierarchical data structure + * representing the content in the document. + * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance + * Optional. The history of this annotation. + * @type bool $redacted + * Optional. Whether the entity will be redacted for de-identification + * purposes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Provenance of the entity. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null + */ + public function getTextAnchor() + { + return $this->text_anchor; + } + + public function hasTextAnchor() + { + return isset($this->text_anchor); + } + + public function clearTextAnchor() + { + unset($this->text_anchor); + } + + /** + * Optional. Provenance of the entity. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var + * @return $this + */ + public function setTextAnchor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\TextAnchor::class); + $this->text_anchor = $var; + + return $this; + } + + /** + * Required. Entity type from a schema e.g. `Address`. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Required. Entity type from a schema e.g. `Address`. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. + * + * Generated from protobuf field string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMentionText() + { + return $this->mention_text; + } + + /** + * Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. + * + * Generated from protobuf field string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMentionText($var) + { + GPBUtil::checkString($var, True); + $this->mention_text = $var; + + return $this; + } + + /** + * Optional. Deprecated. Use `id` field instead. + * + * Generated from protobuf field string mention_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMentionId() + { + return $this->mention_id; + } + + /** + * Optional. Deprecated. Use `id` field instead. + * + * Generated from protobuf field string mention_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMentionId($var) + { + GPBUtil::checkString($var, True); + $this->mention_id = $var; + + return $this; + } + + /** + * Optional. Confidence of detected Schema entity. Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Optional. Confidence of detected Schema entity. Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * Optional. Represents the provenance of this entity wrt. the location on + * the page where it was found. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\Document\PageAnchor|null + */ + public function getPageAnchor() + { + return $this->page_anchor; + } + + public function hasPageAnchor() + { + return isset($this->page_anchor); + } + + public function clearPageAnchor() + { + unset($this->page_anchor); + } + + /** + * Optional. Represents the provenance of this entity wrt. the location on + * the page where it was found. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\Document\PageAnchor $var + * @return $this + */ + public function setPageAnchor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\PageAnchor::class); + $this->page_anchor = $var; + + return $this; + } + + /** + * Optional. Canonical id. This will be a unique value in the entity list + * for this document. + * + * Generated from protobuf field string id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Optional. Canonical id. This will be a unique value in the entity list + * for this document. + * + * Generated from protobuf field string id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Optional. Normalized entity value. Absent if the extracted value could + * not be converted or the type (e.g. address) is not supported for certain + * parsers. This field is also only populated for certain supported document + * types. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue|null + */ + public function getNormalizedValue() + { + return $this->normalized_value; + } + + public function hasNormalizedValue() + { + return isset($this->normalized_value); + } + + public function clearNormalizedValue() + { + unset($this->normalized_value); + } + + /** + * Optional. Normalized entity value. Absent if the extracted value could + * not be converted or the type (e.g. address) is not supported for certain + * parsers. This field is also only populated for certain supported document + * types. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue $var + * @return $this + */ + public function setNormalizedValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue::class); + $this->normalized_value = $var; + + return $this; + } + + /** + * Optional. Entities can be nested to form a hierarchical data structure + * representing the content in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProperties() + { + return $this->properties; + } + + /** + * Optional. Entities can be nested to form a hierarchical data structure + * representing the content in the document. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProperties($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Entity::class); + $this->properties = $arr; + + return $this; + } + + /** + * Optional. The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null + */ + public function getProvenance() + { + return $this->provenance; + } + + public function hasProvenance() + { + return isset($this->provenance); + } + + public function clearProvenance() + { + unset($this->provenance); + } + + /** + * Optional. The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var + * @return $this + */ + public function setProvenance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $var; + + return $this; + } + + /** + * Optional. Whether the entity will be redacted for de-identification + * purposes. + * + * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRedacted() + { + return $this->redacted; + } + + /** + * Optional. Whether the entity will be redacted for de-identification + * purposes. + * + * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRedacted($var) + { + GPBUtil::checkBool($var); + $this->redacted = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Entity::class, \Google\Cloud\DocumentAI\V1\Document_Entity::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity/NormalizedValue.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity/NormalizedValue.php new file mode 100644 index 000000000000..d6f086a4508c --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity/NormalizedValue.php @@ -0,0 +1,357 @@ +google.cloud.documentai.v1.Document.Entity.NormalizedValue + */ +class NormalizedValue extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. An optional field to store a normalized string. + * For some entity types, one of respective `structured_value` fields may + * also be populated. Also not all the types of `structured_value` will be + * normalized. For example, some processors may not generate `float` + * or `integer` normalized text by default. + * Below are sample formats mapped to structured values. + * - Money/Currency type (`money_value`) is in the ISO 4217 text format. + * - Date type (`date_value`) is in the ISO 8601 text format. + * - Datetime type (`datetime_value`) is in the ISO 8601 text format. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text = ''; + protected $structured_value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\Money $money_value + * Money value. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + * @type \Google\Type\Date $date_value + * Date value. Includes year, month, day. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + * @type \Google\Type\DateTime $datetime_value + * DateTime value. Includes date, time, and timezone. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + * @type \Google\Type\PostalAddress $address_value + * Postal address. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + * @type bool $boolean_value + * Boolean value. Can be used for entities with binary values, or for + * checkboxes. + * @type int $integer_value + * Integer value. + * @type float $float_value + * Float value. + * @type string $text + * Optional. An optional field to store a normalized string. + * For some entity types, one of respective `structured_value` fields may + * also be populated. Also not all the types of `structured_value` will be + * normalized. For example, some processors may not generate `float` + * or `integer` normalized text by default. + * Below are sample formats mapped to structured values. + * - Money/Currency type (`money_value`) is in the ISO 4217 text format. + * - Date type (`date_value`) is in the ISO 8601 text format. + * - Datetime type (`datetime_value`) is in the ISO 8601 text format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Money value. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + * + * Generated from protobuf field .google.type.Money money_value = 2; + * @return \Google\Type\Money|null + */ + public function getMoneyValue() + { + return $this->readOneof(2); + } + + public function hasMoneyValue() + { + return $this->hasOneof(2); + } + + /** + * Money value. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/money.proto + * + * Generated from protobuf field .google.type.Money money_value = 2; + * @param \Google\Type\Money $var + * @return $this + */ + public function setMoneyValue($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Date value. Includes year, month, day. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + * + * Generated from protobuf field .google.type.Date date_value = 3; + * @return \Google\Type\Date|null + */ + public function getDateValue() + { + return $this->readOneof(3); + } + + public function hasDateValue() + { + return $this->hasOneof(3); + } + + /** + * Date value. Includes year, month, day. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/date.proto + * + * Generated from protobuf field .google.type.Date date_value = 3; + * @param \Google\Type\Date $var + * @return $this + */ + public function setDateValue($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * DateTime value. Includes date, time, and timezone. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + * + * Generated from protobuf field .google.type.DateTime datetime_value = 4; + * @return \Google\Type\DateTime|null + */ + public function getDatetimeValue() + { + return $this->readOneof(4); + } + + public function hasDatetimeValue() + { + return $this->hasOneof(4); + } + + /** + * DateTime value. Includes date, time, and timezone. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto + * + * Generated from protobuf field .google.type.DateTime datetime_value = 4; + * @param \Google\Type\DateTime $var + * @return $this + */ + public function setDatetimeValue($var) + { + GPBUtil::checkMessage($var, \Google\Type\DateTime::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Postal address. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + * + * Generated from protobuf field .google.type.PostalAddress address_value = 5; + * @return \Google\Type\PostalAddress|null + */ + public function getAddressValue() + { + return $this->readOneof(5); + } + + public function hasAddressValue() + { + return $this->hasOneof(5); + } + + /** + * Postal address. See also: + * https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto + * + * Generated from protobuf field .google.type.PostalAddress address_value = 5; + * @param \Google\Type\PostalAddress $var + * @return $this + */ + public function setAddressValue($var) + { + GPBUtil::checkMessage($var, \Google\Type\PostalAddress::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Boolean value. Can be used for entities with binary values, or for + * checkboxes. + * + * Generated from protobuf field bool boolean_value = 6; + * @return bool + */ + public function getBooleanValue() + { + return $this->readOneof(6); + } + + public function hasBooleanValue() + { + return $this->hasOneof(6); + } + + /** + * Boolean value. Can be used for entities with binary values, or for + * checkboxes. + * + * Generated from protobuf field bool boolean_value = 6; + * @param bool $var + * @return $this + */ + public function setBooleanValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Integer value. + * + * Generated from protobuf field int32 integer_value = 7; + * @return int + */ + public function getIntegerValue() + { + return $this->readOneof(7); + } + + public function hasIntegerValue() + { + return $this->hasOneof(7); + } + + /** + * Integer value. + * + * Generated from protobuf field int32 integer_value = 7; + * @param int $var + * @return $this + */ + public function setIntegerValue($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Float value. + * + * Generated from protobuf field float float_value = 8; + * @return float + */ + public function getFloatValue() + { + return $this->readOneof(8); + } + + public function hasFloatValue() + { + return $this->hasOneof(8); + } + + /** + * Float value. + * + * Generated from protobuf field float float_value = 8; + * @param float $var + * @return $this + */ + public function setFloatValue($var) + { + GPBUtil::checkFloat($var); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Optional. An optional field to store a normalized string. + * For some entity types, one of respective `structured_value` fields may + * also be populated. Also not all the types of `structured_value` will be + * normalized. For example, some processors may not generate `float` + * or `integer` normalized text by default. + * Below are sample formats mapped to structured values. + * - Money/Currency type (`money_value`) is in the ISO 4217 text format. + * - Date type (`date_value`) is in the ISO 8601 text format. + * - Datetime type (`datetime_value`) is in the ISO 8601 text format. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Optional. An optional field to store a normalized string. + * For some entity types, one of respective `structured_value` fields may + * also be populated. Also not all the types of `structured_value` will be + * normalized. For example, some processors may not generate `float` + * or `integer` normalized text by default. + * Below are sample formats mapped to structured values. + * - Money/Currency type (`money_value`) is in the ISO 4217 text format. + * - Date type (`date_value`) is in the ISO 8601 text format. + * - Datetime type (`datetime_value`) is in the ISO 8601 text format. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * @return string + */ + public function getStructuredValue() + { + return $this->whichOneof("structured_value"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NormalizedValue::class, \Google\Cloud\DocumentAI\V1\Document_Entity_NormalizedValue::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/EntityRelation.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/EntityRelation.php new file mode 100644 index 000000000000..ba0880d70ebd --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/EntityRelation.php @@ -0,0 +1,139 @@ +google.cloud.documentai.v1.Document.EntityRelation + */ +class EntityRelation extends \Google\Protobuf\Internal\Message +{ + /** + * Subject entity id. + * + * Generated from protobuf field string subject_id = 1; + */ + protected $subject_id = ''; + /** + * Object entity id. + * + * Generated from protobuf field string object_id = 2; + */ + protected $object_id = ''; + /** + * Relationship description. + * + * Generated from protobuf field string relation = 3; + */ + protected $relation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subject_id + * Subject entity id. + * @type string $object_id + * Object entity id. + * @type string $relation + * Relationship description. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Subject entity id. + * + * Generated from protobuf field string subject_id = 1; + * @return string + */ + public function getSubjectId() + { + return $this->subject_id; + } + + /** + * Subject entity id. + * + * Generated from protobuf field string subject_id = 1; + * @param string $var + * @return $this + */ + public function setSubjectId($var) + { + GPBUtil::checkString($var, True); + $this->subject_id = $var; + + return $this; + } + + /** + * Object entity id. + * + * Generated from protobuf field string object_id = 2; + * @return string + */ + public function getObjectId() + { + return $this->object_id; + } + + /** + * Object entity id. + * + * Generated from protobuf field string object_id = 2; + * @param string $var + * @return $this + */ + public function setObjectId($var) + { + GPBUtil::checkString($var, True); + $this->object_id = $var; + + return $this; + } + + /** + * Relationship description. + * + * Generated from protobuf field string relation = 3; + * @return string + */ + public function getRelation() + { + return $this->relation; + } + + /** + * Relationship description. + * + * Generated from protobuf field string relation = 3; + * @param string $var + * @return $this + */ + public function setRelation($var) + { + GPBUtil::checkString($var, True); + $this->relation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EntityRelation::class, \Google\Cloud\DocumentAI\V1\Document_EntityRelation::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page.php new file mode 100644 index 000000000000..34e47ccab957 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page.php @@ -0,0 +1,719 @@ +google.cloud.documentai.v1.Document.Page + */ +class Page extends \Google\Protobuf\Internal\Message +{ + /** + * 1-based index for current + * [Page][google.cloud.documentai.v1.Document.Page] in a parent + * [Document][google.cloud.documentai.v1.Document]. Useful when a page is + * taken out of a [Document][google.cloud.documentai.v1.Document] for + * individual processing. + * + * Generated from protobuf field int32 page_number = 1; + */ + protected $page_number = 0; + /** + * Rendered image for this page. This image is preprocessed to remove any + * skew, rotation, and distortions such that the annotation bounding boxes + * can be upright and axis-aligned. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Image image = 13; + */ + protected $image = null; + /** + * Transformation matrices that were applied to the original document image + * to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Matrix transforms = 14; + */ + private $transforms; + /** + * Physical dimension of the page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Dimension dimension = 2; + */ + protected $dimension = null; + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 3; + */ + protected $layout = null; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + */ + private $detected_languages; + /** + * A list of visually detected text blocks on the page. + * A block has a set of lines (collected into paragraphs) that have a common + * line-spacing and orientation. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Block blocks = 5; + */ + private $blocks; + /** + * A list of visually detected text paragraphs on the page. + * A collection of lines that a human would perceive as a paragraph. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Paragraph paragraphs = 6; + */ + private $paragraphs; + /** + * A list of visually detected text lines on the page. + * A collection of tokens that a human would perceive as a line. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Line lines = 7; + */ + private $lines; + /** + * A list of visually detected tokens on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Token tokens = 8; + */ + private $tokens; + /** + * A list of detected non-text visual elements e.g. checkbox, + * signature etc. on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.VisualElement visual_elements = 9; + */ + private $visual_elements; + /** + * A list of visually detected tables on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table tables = 10; + */ + private $tables; + /** + * A list of visually detected form fields on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.FormField form_fields = 11; + */ + private $form_fields; + /** + * A list of visually detected symbols on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Symbol symbols = 12; + */ + private $symbols; + /** + * A list of detected barcodes. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + */ + private $detected_barcodes; + /** + * Image quality scores. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.ImageQualityScores image_quality_scores = 17; + */ + protected $image_quality_scores = null; + /** + * The history of this page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 16 [deprecated = true]; + * @deprecated + */ + protected $provenance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_number + * 1-based index for current + * [Page][google.cloud.documentai.v1.Document.Page] in a parent + * [Document][google.cloud.documentai.v1.Document]. Useful when a page is + * taken out of a [Document][google.cloud.documentai.v1.Document] for + * individual processing. + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Image $image + * Rendered image for this page. This image is preprocessed to remove any + * skew, rotation, and distortions such that the annotation bounding boxes + * can be upright and axis-aligned. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Matrix>|\Google\Protobuf\Internal\RepeatedField $transforms + * Transformation matrices that were applied to the original document image + * to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Dimension $dimension + * Physical dimension of the page. + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Block>|\Google\Protobuf\Internal\RepeatedField $blocks + * A list of visually detected text blocks on the page. + * A block has a set of lines (collected into paragraphs) that have a common + * line-spacing and orientation. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Paragraph>|\Google\Protobuf\Internal\RepeatedField $paragraphs + * A list of visually detected text paragraphs on the page. + * A collection of lines that a human would perceive as a paragraph. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Line>|\Google\Protobuf\Internal\RepeatedField $lines + * A list of visually detected text lines on the page. + * A collection of tokens that a human would perceive as a line. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Token>|\Google\Protobuf\Internal\RepeatedField $tokens + * A list of visually detected tokens on the page. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\VisualElement>|\Google\Protobuf\Internal\RepeatedField $visual_elements + * A list of detected non-text visual elements e.g. checkbox, + * signature etc. on the page. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table>|\Google\Protobuf\Internal\RepeatedField $tables + * A list of visually detected tables on the page. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\FormField>|\Google\Protobuf\Internal\RepeatedField $form_fields + * A list of visually detected form fields on the page. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Symbol>|\Google\Protobuf\Internal\RepeatedField $symbols + * A list of visually detected symbols on the page. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedBarcode>|\Google\Protobuf\Internal\RepeatedField $detected_barcodes + * A list of detected barcodes. + * @type \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores $image_quality_scores + * Image quality scores. + * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance + * The history of this page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * 1-based index for current + * [Page][google.cloud.documentai.v1.Document.Page] in a parent + * [Document][google.cloud.documentai.v1.Document]. Useful when a page is + * taken out of a [Document][google.cloud.documentai.v1.Document] for + * individual processing. + * + * Generated from protobuf field int32 page_number = 1; + * @return int + */ + public function getPageNumber() + { + return $this->page_number; + } + + /** + * 1-based index for current + * [Page][google.cloud.documentai.v1.Document.Page] in a parent + * [Document][google.cloud.documentai.v1.Document]. Useful when a page is + * taken out of a [Document][google.cloud.documentai.v1.Document] for + * individual processing. + * + * Generated from protobuf field int32 page_number = 1; + * @param int $var + * @return $this + */ + public function setPageNumber($var) + { + GPBUtil::checkInt32($var); + $this->page_number = $var; + + return $this; + } + + /** + * Rendered image for this page. This image is preprocessed to remove any + * skew, rotation, and distortions such that the annotation bounding boxes + * can be upright and axis-aligned. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Image image = 13; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Rendered image for this page. This image is preprocessed to remove any + * skew, rotation, and distortions such that the annotation bounding boxes + * can be upright and axis-aligned. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Image image = 13; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Image::class); + $this->image = $var; + + return $this; + } + + /** + * Transformation matrices that were applied to the original document image + * to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Matrix transforms = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransforms() + { + return $this->transforms; + } + + /** + * Transformation matrices that were applied to the original document image + * to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Matrix transforms = 14; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Matrix>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransforms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Matrix::class); + $this->transforms = $arr; + + return $this; + } + + /** + * Physical dimension of the page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Dimension dimension = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Dimension|null + */ + public function getDimension() + { + return $this->dimension; + } + + public function hasDimension() + { + return isset($this->dimension); + } + + public function clearDimension() + { + unset($this->dimension); + } + + /** + * Physical dimension of the page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Dimension dimension = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Dimension $var + * @return $this + */ + public function setDimension($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Dimension::class); + $this->dimension = $var; + + return $this; + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 3; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 3; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + + /** + * A list of visually detected text blocks on the page. + * A block has a set of lines (collected into paragraphs) that have a common + * line-spacing and orientation. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Block blocks = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBlocks() + { + return $this->blocks; + } + + /** + * A list of visually detected text blocks on the page. + * A block has a set of lines (collected into paragraphs) that have a common + * line-spacing and orientation. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Block blocks = 5; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Block>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBlocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Block::class); + $this->blocks = $arr; + + return $this; + } + + /** + * A list of visually detected text paragraphs on the page. + * A collection of lines that a human would perceive as a paragraph. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Paragraph paragraphs = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParagraphs() + { + return $this->paragraphs; + } + + /** + * A list of visually detected text paragraphs on the page. + * A collection of lines that a human would perceive as a paragraph. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Paragraph paragraphs = 6; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Paragraph>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParagraphs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Paragraph::class); + $this->paragraphs = $arr; + + return $this; + } + + /** + * A list of visually detected text lines on the page. + * A collection of tokens that a human would perceive as a line. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Line lines = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLines() + { + return $this->lines; + } + + /** + * A list of visually detected text lines on the page. + * A collection of tokens that a human would perceive as a line. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Line lines = 7; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Line>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLines($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Line::class); + $this->lines = $arr; + + return $this; + } + + /** + * A list of visually detected tokens on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Token tokens = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTokens() + { + return $this->tokens; + } + + /** + * A list of visually detected tokens on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Token tokens = 8; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Token>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTokens($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Token::class); + $this->tokens = $arr; + + return $this; + } + + /** + * A list of detected non-text visual elements e.g. checkbox, + * signature etc. on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.VisualElement visual_elements = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVisualElements() + { + return $this->visual_elements; + } + + /** + * A list of detected non-text visual elements e.g. checkbox, + * signature etc. on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.VisualElement visual_elements = 9; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\VisualElement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVisualElements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\VisualElement::class); + $this->visual_elements = $arr; + + return $this; + } + + /** + * A list of visually detected tables on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table tables = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTables() + { + return $this->tables; + } + + /** + * A list of visually detected tables on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table tables = 10; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table::class); + $this->tables = $arr; + + return $this; + } + + /** + * A list of visually detected form fields on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.FormField form_fields = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFormFields() + { + return $this->form_fields; + } + + /** + * A list of visually detected form fields on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.FormField form_fields = 11; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\FormField>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFormFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\FormField::class); + $this->form_fields = $arr; + + return $this; + } + + /** + * A list of visually detected symbols on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Symbol symbols = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSymbols() + { + return $this->symbols; + } + + /** + * A list of visually detected symbols on the page. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Symbol symbols = 12; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Symbol>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSymbols($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Symbol::class); + $this->symbols = $arr; + + return $this; + } + + /** + * A list of detected barcodes. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedBarcodes() + { + return $this->detected_barcodes; + } + + /** + * A list of detected barcodes. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedBarcode>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedBarcodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedBarcode::class); + $this->detected_barcodes = $arr; + + return $this; + } + + /** + * Image quality scores. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.ImageQualityScores image_quality_scores = 17; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores|null + */ + public function getImageQualityScores() + { + return $this->image_quality_scores; + } + + public function hasImageQualityScores() + { + return isset($this->image_quality_scores); + } + + public function clearImageQualityScores() + { + unset($this->image_quality_scores); + } + + /** + * Image quality scores. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.ImageQualityScores image_quality_scores = 17; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores $var + * @return $this + */ + public function setImageQualityScores($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores::class); + $this->image_quality_scores = $var; + + return $this; + } + + /** + * The history of this page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 16 [deprecated = true]; + * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null + * @deprecated + */ + public function getProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return $this->provenance; + } + + public function hasProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return isset($this->provenance); + } + + public function clearProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + unset($this->provenance); + } + + /** + * The history of this page. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 16 [deprecated = true]; + * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var + * @return $this + * @deprecated + */ + public function setProvenance($var) + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Page::class, \Google\Cloud\DocumentAI\V1\Document_Page::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Block.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Block.php new file mode 100644 index 000000000000..e6b0f8115556 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Block.php @@ -0,0 +1,170 @@ +google.cloud.documentai.v1.Document.Page.Block + */ +class Block extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Block][google.cloud.documentai.v1.Document.Page.Block]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + */ + private $detected_languages; + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @deprecated + */ + protected $provenance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Block][google.cloud.documentai.v1.Document.Page.Block]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance + * The history of this annotation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Block][google.cloud.documentai.v1.Document.Page.Block]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Block][google.cloud.documentai.v1.Document.Page.Block]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null + * @deprecated + */ + public function getProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return $this->provenance; + } + + public function hasProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return isset($this->provenance); + } + + public function clearProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + unset($this->provenance); + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var + * @return $this + * @deprecated + */ + public function setProvenance($var) + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Block::class, \Google\Cloud\DocumentAI\V1\Document_Page_Block::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedBarcode.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedBarcode.php new file mode 100644 index 000000000000..813cac1753e1 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedBarcode.php @@ -0,0 +1,132 @@ +google.cloud.documentai.v1.Document.Page.DetectedBarcode + */ +class DetectedBarcode extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * Detailed barcode information of the + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; + */ + protected $barcode = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * @type \Google\Cloud\DocumentAI\V1\Barcode $barcode + * Detailed barcode information of the + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * Detailed barcode information of the + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; + * @return \Google\Cloud\DocumentAI\V1\Barcode|null + */ + public function getBarcode() + { + return $this->barcode; + } + + public function hasBarcode() + { + return isset($this->barcode); + } + + public function clearBarcode() + { + unset($this->barcode); + } + + /** + * Detailed barcode information of the + * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; + * @param \Google\Cloud\DocumentAI\V1\Barcode $var + * @return $this + */ + public function setBarcode($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Barcode::class); + $this->barcode = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DetectedBarcode::class, \Google\Cloud\DocumentAI\V1\Document_Page_DetectedBarcode::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedLanguage.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedLanguage.php new file mode 100644 index 000000000000..047bb47a331f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedLanguage.php @@ -0,0 +1,112 @@ +google.cloud.documentai.v1.Document.Page.DetectedLanguage + */ +class DetectedLanguage extends \Google\Protobuf\Internal\Message +{ + /** + * The [BCP-47 language + * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), + * such as `en-US` or `sr-Latn`. + * + * Generated from protobuf field string language_code = 1; + */ + protected $language_code = ''; + /** + * Confidence of detected language. Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * The [BCP-47 language + * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), + * such as `en-US` or `sr-Latn`. + * @type float $confidence + * Confidence of detected language. Range `[0, 1]`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * The [BCP-47 language + * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), + * such as `en-US` or `sr-Latn`. + * + * Generated from protobuf field string language_code = 1; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * The [BCP-47 language + * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), + * such as `en-US` or `sr-Latn`. + * + * Generated from protobuf field string language_code = 1; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Confidence of detected language. Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Confidence of detected language. Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DetectedLanguage::class, \Google\Cloud\DocumentAI\V1\Document_Page_DetectedLanguage::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Dimension.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Dimension.php new file mode 100644 index 000000000000..94fa7020c1c5 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Dimension.php @@ -0,0 +1,138 @@ +google.cloud.documentai.v1.Document.Page.Dimension + */ +class Dimension extends \Google\Protobuf\Internal\Message +{ + /** + * Page width. + * + * Generated from protobuf field float width = 1; + */ + protected $width = 0.0; + /** + * Page height. + * + * Generated from protobuf field float height = 2; + */ + protected $height = 0.0; + /** + * Dimension unit. + * + * Generated from protobuf field string unit = 3; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $width + * Page width. + * @type float $height + * Page height. + * @type string $unit + * Dimension unit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Page width. + * + * Generated from protobuf field float width = 1; + * @return float + */ + public function getWidth() + { + return $this->width; + } + + /** + * Page width. + * + * Generated from protobuf field float width = 1; + * @param float $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkFloat($var); + $this->width = $var; + + return $this; + } + + /** + * Page height. + * + * Generated from protobuf field float height = 2; + * @return float + */ + public function getHeight() + { + return $this->height; + } + + /** + * Page height. + * + * Generated from protobuf field float height = 2; + * @param float $var + * @return $this + */ + public function setHeight($var) + { + GPBUtil::checkFloat($var); + $this->height = $var; + + return $this; + } + + /** + * Dimension unit. + * + * Generated from protobuf field string unit = 3; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * Dimension unit. + * + * Generated from protobuf field string unit = 3; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Dimension::class, \Google\Cloud\DocumentAI\V1\Document_Page_Dimension::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/FormField.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/FormField.php new file mode 100644 index 000000000000..8eba8df34300 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/FormField.php @@ -0,0 +1,382 @@ +google.cloud.documentai.v1.Document.Page.FormField + */ +class FormField extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; + */ + protected $field_name = null; + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; + */ + protected $field_value = null; + /** + * A list of detected languages for name together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage name_detected_languages = 3; + */ + private $name_detected_languages; + /** + * A list of detected languages for value together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage value_detected_languages = 4; + */ + private $value_detected_languages; + /** + * If the value is non-textual, this field represents the type. Current + * valid values are: + * - blank (this indicates the `field_value` is normal text) + * - `unfilled_checkbox` + * - `filled_checkbox` + * + * Generated from protobuf field string value_type = 5; + */ + protected $value_type = ''; + /** + * Created for Labeling UI to export key text. + * If corrections were made to the text identified by the + * `field_name.text_anchor`, this field will contain the correction. + * + * Generated from protobuf field string corrected_key_text = 6; + */ + protected $corrected_key_text = ''; + /** + * Created for Labeling UI to export value text. + * If corrections were made to the text identified by the + * `field_value.text_anchor`, this field will contain the correction. + * + * Generated from protobuf field string corrected_value_text = 7; + */ + protected $corrected_value_text = ''; + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 8; + */ + protected $provenance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $field_name + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $field_value + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $name_detected_languages + * A list of detected languages for name together with confidence. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $value_detected_languages + * A list of detected languages for value together with confidence. + * @type string $value_type + * If the value is non-textual, this field represents the type. Current + * valid values are: + * - blank (this indicates the `field_value` is normal text) + * - `unfilled_checkbox` + * - `filled_checkbox` + * @type string $corrected_key_text + * Created for Labeling UI to export key text. + * If corrections were made to the text identified by the + * `field_name.text_anchor`, this field will contain the correction. + * @type string $corrected_value_text + * Created for Labeling UI to export value text. + * If corrections were made to the text identified by the + * `field_value.text_anchor`, this field will contain the correction. + * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance + * The history of this annotation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getFieldName() + { + return $this->field_name; + } + + public function hasFieldName() + { + return isset($this->field_name); + } + + public function clearFieldName() + { + unset($this->field_name); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setFieldName($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->field_name = $var; + + return $this; + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getFieldValue() + { + return $this->field_value; + } + + public function hasFieldValue() + { + return isset($this->field_value); + } + + public function clearFieldValue() + { + unset($this->field_value); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setFieldValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->field_value = $var; + + return $this; + } + + /** + * A list of detected languages for name together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage name_detected_languages = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNameDetectedLanguages() + { + return $this->name_detected_languages; + } + + /** + * A list of detected languages for name together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage name_detected_languages = 3; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNameDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->name_detected_languages = $arr; + + return $this; + } + + /** + * A list of detected languages for value together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage value_detected_languages = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValueDetectedLanguages() + { + return $this->value_detected_languages; + } + + /** + * A list of detected languages for value together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage value_detected_languages = 4; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValueDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->value_detected_languages = $arr; + + return $this; + } + + /** + * If the value is non-textual, this field represents the type. Current + * valid values are: + * - blank (this indicates the `field_value` is normal text) + * - `unfilled_checkbox` + * - `filled_checkbox` + * + * Generated from protobuf field string value_type = 5; + * @return string + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * If the value is non-textual, this field represents the type. Current + * valid values are: + * - blank (this indicates the `field_value` is normal text) + * - `unfilled_checkbox` + * - `filled_checkbox` + * + * Generated from protobuf field string value_type = 5; + * @param string $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkString($var, True); + $this->value_type = $var; + + return $this; + } + + /** + * Created for Labeling UI to export key text. + * If corrections were made to the text identified by the + * `field_name.text_anchor`, this field will contain the correction. + * + * Generated from protobuf field string corrected_key_text = 6; + * @return string + */ + public function getCorrectedKeyText() + { + return $this->corrected_key_text; + } + + /** + * Created for Labeling UI to export key text. + * If corrections were made to the text identified by the + * `field_name.text_anchor`, this field will contain the correction. + * + * Generated from protobuf field string corrected_key_text = 6; + * @param string $var + * @return $this + */ + public function setCorrectedKeyText($var) + { + GPBUtil::checkString($var, True); + $this->corrected_key_text = $var; + + return $this; + } + + /** + * Created for Labeling UI to export value text. + * If corrections were made to the text identified by the + * `field_value.text_anchor`, this field will contain the correction. + * + * Generated from protobuf field string corrected_value_text = 7; + * @return string + */ + public function getCorrectedValueText() + { + return $this->corrected_value_text; + } + + /** + * Created for Labeling UI to export value text. + * If corrections were made to the text identified by the + * `field_value.text_anchor`, this field will contain the correction. + * + * Generated from protobuf field string corrected_value_text = 7; + * @param string $var + * @return $this + */ + public function setCorrectedValueText($var) + { + GPBUtil::checkString($var, True); + $this->corrected_value_text = $var; + + return $this; + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 8; + * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null + */ + public function getProvenance() + { + return $this->provenance; + } + + public function hasProvenance() + { + return isset($this->provenance); + } + + public function clearProvenance() + { + unset($this->provenance); + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 8; + * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var + * @return $this + */ + public function setProvenance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FormField::class, \Google\Cloud\DocumentAI\V1\Document_Page_FormField::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Image.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Image.php new file mode 100644 index 000000000000..d148308f1446 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Image.php @@ -0,0 +1,180 @@ +google.cloud.documentai.v1.Document.Page.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * Raw byte content of the image. + * + * Generated from protobuf field bytes content = 1; + */ + protected $content = ''; + /** + * Encoding [media type (MIME + * type)](https://www.iana.org/assignments/media-types/media-types.xhtml) + * for the image. + * + * Generated from protobuf field string mime_type = 2; + */ + protected $mime_type = ''; + /** + * Width of the image in pixels. + * + * Generated from protobuf field int32 width = 3; + */ + protected $width = 0; + /** + * Height of the image in pixels. + * + * Generated from protobuf field int32 height = 4; + */ + protected $height = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Raw byte content of the image. + * @type string $mime_type + * Encoding [media type (MIME + * type)](https://www.iana.org/assignments/media-types/media-types.xhtml) + * for the image. + * @type int $width + * Width of the image in pixels. + * @type int $height + * Height of the image in pixels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Raw byte content of the image. + * + * Generated from protobuf field bytes content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Raw byte content of the image. + * + * Generated from protobuf field bytes content = 1; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, False); + $this->content = $var; + + return $this; + } + + /** + * Encoding [media type (MIME + * type)](https://www.iana.org/assignments/media-types/media-types.xhtml) + * for the image. + * + * Generated from protobuf field string mime_type = 2; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Encoding [media type (MIME + * type)](https://www.iana.org/assignments/media-types/media-types.xhtml) + * for the image. + * + * Generated from protobuf field string mime_type = 2; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Width of the image in pixels. + * + * Generated from protobuf field int32 width = 3; + * @return int + */ + public function getWidth() + { + return $this->width; + } + + /** + * Width of the image in pixels. + * + * Generated from protobuf field int32 width = 3; + * @param int $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkInt32($var); + $this->width = $var; + + return $this; + } + + /** + * Height of the image in pixels. + * + * Generated from protobuf field int32 height = 4; + * @return int + */ + public function getHeight() + { + return $this->height; + } + + /** + * Height of the image in pixels. + * + * Generated from protobuf field int32 height = 4; + * @param int $var + * @return $this + */ + public function setHeight($var) + { + GPBUtil::checkInt32($var); + $this->height = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Image::class, \Google\Cloud\DocumentAI\V1\Document_Page_Image::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores.php new file mode 100644 index 000000000000..022802ccec08 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores.php @@ -0,0 +1,104 @@ +google.cloud.documentai.v1.Document.Page.ImageQualityScores + */ +class ImageQualityScores extends \Google\Protobuf\Internal\Message +{ + /** + * The overall quality score. Range `[0, 1]` where `1` is perfect quality. + * + * Generated from protobuf field float quality_score = 1; + */ + protected $quality_score = 0.0; + /** + * A list of detected defects. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect detected_defects = 2; + */ + private $detected_defects; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $quality_score + * The overall quality score. Range `[0, 1]` where `1` is perfect quality. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores\DetectedDefect>|\Google\Protobuf\Internal\RepeatedField $detected_defects + * A list of detected defects. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * The overall quality score. Range `[0, 1]` where `1` is perfect quality. + * + * Generated from protobuf field float quality_score = 1; + * @return float + */ + public function getQualityScore() + { + return $this->quality_score; + } + + /** + * The overall quality score. Range `[0, 1]` where `1` is perfect quality. + * + * Generated from protobuf field float quality_score = 1; + * @param float $var + * @return $this + */ + public function setQualityScore($var) + { + GPBUtil::checkFloat($var); + $this->quality_score = $var; + + return $this; + } + + /** + * A list of detected defects. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect detected_defects = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedDefects() + { + return $this->detected_defects; + } + + /** + * A list of detected defects. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect detected_defects = 2; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores\DetectedDefect>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedDefects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores\DetectedDefect::class); + $this->detected_defects = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ImageQualityScores::class, \Google\Cloud\DocumentAI\V1\Document_Page_ImageQualityScores::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores/DetectedDefect.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores/DetectedDefect.php new file mode 100644 index 000000000000..349207260af6 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores/DetectedDefect.php @@ -0,0 +1,140 @@ +google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + */ +class DetectedDefect extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the defect type. Supported values are: + * - `quality/defect_blurry` + * - `quality/defect_noisy` + * - `quality/defect_dark` + * - `quality/defect_faint` + * - `quality/defect_text_too_small` + * - `quality/defect_document_cutoff` + * - `quality/defect_text_cutoff` + * - `quality/defect_glare` + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * Confidence of detected defect. Range `[0, 1]` where `1` indicates + * strong confidence that the defect exists. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * Name of the defect type. Supported values are: + * - `quality/defect_blurry` + * - `quality/defect_noisy` + * - `quality/defect_dark` + * - `quality/defect_faint` + * - `quality/defect_text_too_small` + * - `quality/defect_document_cutoff` + * - `quality/defect_text_cutoff` + * - `quality/defect_glare` + * @type float $confidence + * Confidence of detected defect. Range `[0, 1]` where `1` indicates + * strong confidence that the defect exists. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Name of the defect type. Supported values are: + * - `quality/defect_blurry` + * - `quality/defect_noisy` + * - `quality/defect_dark` + * - `quality/defect_faint` + * - `quality/defect_text_too_small` + * - `quality/defect_document_cutoff` + * - `quality/defect_text_cutoff` + * - `quality/defect_glare` + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Name of the defect type. Supported values are: + * - `quality/defect_blurry` + * - `quality/defect_noisy` + * - `quality/defect_dark` + * - `quality/defect_faint` + * - `quality/defect_text_too_small` + * - `quality/defect_document_cutoff` + * - `quality/defect_text_cutoff` + * - `quality/defect_glare` + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Confidence of detected defect. Range `[0, 1]` where `1` indicates + * strong confidence that the defect exists. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Confidence of detected defect. Range `[0, 1]` where `1` indicates + * strong confidence that the defect exists. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DetectedDefect::class, \Google\Cloud\DocumentAI\V1\Document_Page_ImageQualityScores_DetectedDefect::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout.php new file mode 100644 index 000000000000..88a05d40216e --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout.php @@ -0,0 +1,220 @@ +google.cloud.documentai.v1.Document.Page.Layout + */ +class Layout extends \Google\Protobuf\Internal\Message +{ + /** + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + protected $text_anchor = null; + /** + * Confidence of the current + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + * context of the object this layout is for. e.g. confidence can be for a + * single token, a table, a visual element, etc. depending on context. + * Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + /** + * The bounding polygon for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * + * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; + */ + protected $bounding_poly = null; + /** + * Detected orientation for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; + */ + protected $orientation = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * @type float $confidence + * Confidence of the current + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + * context of the object this layout is for. e.g. confidence can be for a + * single token, a table, a visual element, etc. depending on context. + * Range `[0, 1]`. + * @type \Google\Cloud\DocumentAI\V1\BoundingPoly $bounding_poly + * The bounding polygon for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * @type int $orientation + * Detected orientation for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null + */ + public function getTextAnchor() + { + return $this->text_anchor; + } + + public function hasTextAnchor() + { + return isset($this->text_anchor); + } + + public function clearTextAnchor() + { + unset($this->text_anchor); + } + + /** + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var + * @return $this + */ + public function setTextAnchor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\TextAnchor::class); + $this->text_anchor = $var; + + return $this; + } + + /** + * Confidence of the current + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + * context of the object this layout is for. e.g. confidence can be for a + * single token, a table, a visual element, etc. depending on context. + * Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Confidence of the current + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within + * context of the object this layout is for. e.g. confidence can be for a + * single token, a table, a visual element, etc. depending on context. + * Range `[0, 1]`. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * The bounding polygon for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * + * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; + * @return \Google\Cloud\DocumentAI\V1\BoundingPoly|null + */ + public function getBoundingPoly() + { + return $this->bounding_poly; + } + + public function hasBoundingPoly() + { + return isset($this->bounding_poly); + } + + public function clearBoundingPoly() + { + unset($this->bounding_poly); + } + + /** + * The bounding polygon for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * + * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; + * @param \Google\Cloud\DocumentAI\V1\BoundingPoly $var + * @return $this + */ + public function setBoundingPoly($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BoundingPoly::class); + $this->bounding_poly = $var; + + return $this; + } + + /** + * Detected orientation for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; + * @return int + */ + public function getOrientation() + { + return $this->orientation; + } + + /** + * Detected orientation for the + * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; + * @param int $var + * @return $this + */ + public function setOrientation($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout\Orientation::class); + $this->orientation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Layout::class, \Google\Cloud\DocumentAI\V1\Document_Page_Layout::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout/Orientation.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout/Orientation.php new file mode 100644 index 000000000000..ecbb474f5b17 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout/Orientation.php @@ -0,0 +1,81 @@ +google.cloud.documentai.v1.Document.Page.Layout.Orientation + */ +class Orientation +{ + /** + * Unspecified orientation. + * + * Generated from protobuf enum ORIENTATION_UNSPECIFIED = 0; + */ + const ORIENTATION_UNSPECIFIED = 0; + /** + * Orientation is aligned with page up. + * + * Generated from protobuf enum PAGE_UP = 1; + */ + const PAGE_UP = 1; + /** + * Orientation is aligned with page right. + * Turn the head 90 degrees clockwise from upright to read. + * + * Generated from protobuf enum PAGE_RIGHT = 2; + */ + const PAGE_RIGHT = 2; + /** + * Orientation is aligned with page down. + * Turn the head 180 degrees from upright to read. + * + * Generated from protobuf enum PAGE_DOWN = 3; + */ + const PAGE_DOWN = 3; + /** + * Orientation is aligned with page left. + * Turn the head 90 degrees counterclockwise from upright to read. + * + * Generated from protobuf enum PAGE_LEFT = 4; + */ + const PAGE_LEFT = 4; + + private static $valueToName = [ + self::ORIENTATION_UNSPECIFIED => 'ORIENTATION_UNSPECIFIED', + self::PAGE_UP => 'PAGE_UP', + self::PAGE_RIGHT => 'PAGE_RIGHT', + self::PAGE_DOWN => 'PAGE_DOWN', + self::PAGE_LEFT => 'PAGE_LEFT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Orientation::class, \Google\Cloud\DocumentAI\V1\Document_Page_Layout_Orientation::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Line.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Line.php new file mode 100644 index 000000000000..6a1b91fa2c24 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Line.php @@ -0,0 +1,170 @@ +google.cloud.documentai.v1.Document.Page.Line + */ +class Line extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Line][google.cloud.documentai.v1.Document.Page.Line]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + */ + private $detected_languages; + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @deprecated + */ + protected $provenance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Line][google.cloud.documentai.v1.Document.Page.Line]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance + * The history of this annotation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Line][google.cloud.documentai.v1.Document.Page.Line]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Line][google.cloud.documentai.v1.Document.Page.Line]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null + * @deprecated + */ + public function getProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return $this->provenance; + } + + public function hasProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return isset($this->provenance); + } + + public function clearProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + unset($this->provenance); + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var + * @return $this + * @deprecated + */ + public function setProvenance($var) + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Line::class, \Google\Cloud\DocumentAI\V1\Document_Page_Line::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Matrix.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Matrix.php new file mode 100644 index 000000000000..5bdd20b17c61 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Matrix.php @@ -0,0 +1,185 @@ +google.cloud.documentai.v1.Document.Page.Matrix + */ +class Matrix extends \Google\Protobuf\Internal\Message +{ + /** + * Number of rows in the matrix. + * + * Generated from protobuf field int32 rows = 1; + */ + protected $rows = 0; + /** + * Number of columns in the matrix. + * + * Generated from protobuf field int32 cols = 2; + */ + protected $cols = 0; + /** + * This encodes information about what data type the matrix uses. + * For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + * of OpenCV primitive data types, please refer to + * https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + * + * Generated from protobuf field int32 type = 3; + */ + protected $type = 0; + /** + * The matrix data. + * + * Generated from protobuf field bytes data = 4; + */ + protected $data = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $rows + * Number of rows in the matrix. + * @type int $cols + * Number of columns in the matrix. + * @type int $type + * This encodes information about what data type the matrix uses. + * For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + * of OpenCV primitive data types, please refer to + * https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + * @type string $data + * The matrix data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Number of rows in the matrix. + * + * Generated from protobuf field int32 rows = 1; + * @return int + */ + public function getRows() + { + return $this->rows; + } + + /** + * Number of rows in the matrix. + * + * Generated from protobuf field int32 rows = 1; + * @param int $var + * @return $this + */ + public function setRows($var) + { + GPBUtil::checkInt32($var); + $this->rows = $var; + + return $this; + } + + /** + * Number of columns in the matrix. + * + * Generated from protobuf field int32 cols = 2; + * @return int + */ + public function getCols() + { + return $this->cols; + } + + /** + * Number of columns in the matrix. + * + * Generated from protobuf field int32 cols = 2; + * @param int $var + * @return $this + */ + public function setCols($var) + { + GPBUtil::checkInt32($var); + $this->cols = $var; + + return $this; + } + + /** + * This encodes information about what data type the matrix uses. + * For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + * of OpenCV primitive data types, please refer to + * https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + * + * Generated from protobuf field int32 type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * This encodes information about what data type the matrix uses. + * For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list + * of OpenCV primitive data types, please refer to + * https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html + * + * Generated from protobuf field int32 type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkInt32($var); + $this->type = $var; + + return $this; + } + + /** + * The matrix data. + * + * Generated from protobuf field bytes data = 4; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * The matrix data. + * + * Generated from protobuf field bytes data = 4; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Matrix::class, \Google\Cloud\DocumentAI\V1\Document_Page_Matrix::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Paragraph.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Paragraph.php new file mode 100644 index 000000000000..ecf311660ec6 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Paragraph.php @@ -0,0 +1,169 @@ +google.cloud.documentai.v1.Document.Page.Paragraph + */ +class Paragraph extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + */ + private $detected_languages; + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @deprecated + */ + protected $provenance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance + * The history of this annotation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null + * @deprecated + */ + public function getProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return $this->provenance; + } + + public function hasProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return isset($this->provenance); + } + + public function clearProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + unset($this->provenance); + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var + * @return $this + * @deprecated + */ + public function setProvenance($var) + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Paragraph::class, \Google\Cloud\DocumentAI\V1\Document_Page_Paragraph::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Symbol.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Symbol.php new file mode 100644 index 000000000000..823bdb5b507a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Symbol.php @@ -0,0 +1,118 @@ +google.cloud.documentai.v1.Document.Page.Symbol + */ +class Symbol extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + */ + private $detected_languages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Symbol::class, \Google\Cloud\DocumentAI\V1\Document_Page_Symbol::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table.php new file mode 100644 index 000000000000..f92869f57296 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table.php @@ -0,0 +1,237 @@ +google.cloud.documentai.v1.Document.Page.Table + */ +class Table extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Table][google.cloud.documentai.v1.Document.Page.Table]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * Header rows of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow header_rows = 2; + */ + private $header_rows; + /** + * Body rows of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow body_rows = 3; + */ + private $body_rows; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + */ + private $detected_languages; + /** + * The history of this table. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 5 [deprecated = true]; + * @deprecated + */ + protected $provenance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Table][google.cloud.documentai.v1.Document.Page.Table]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $header_rows + * Header rows of the table. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $body_rows + * Body rows of the table. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance + * The history of this table. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Table][google.cloud.documentai.v1.Document.Page.Table]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Table][google.cloud.documentai.v1.Document.Page.Table]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * Header rows of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow header_rows = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaderRows() + { + return $this->header_rows; + } + + /** + * Header rows of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow header_rows = 2; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaderRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow::class); + $this->header_rows = $arr; + + return $this; + } + + /** + * Body rows of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow body_rows = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBodyRows() + { + return $this->body_rows; + } + + /** + * Body rows of the table. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow body_rows = 3; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBodyRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow::class); + $this->body_rows = $arr; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + + /** + * The history of this table. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 5 [deprecated = true]; + * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null + * @deprecated + */ + public function getProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return $this->provenance; + } + + public function hasProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return isset($this->provenance); + } + + public function clearProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + unset($this->provenance); + } + + /** + * The history of this table. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 5 [deprecated = true]; + * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var + * @return $this + * @deprecated + */ + public function setProvenance($var) + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Table::class, \Google\Cloud\DocumentAI\V1\Document_Page_Table::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableCell.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableCell.php new file mode 100644 index 000000000000..083ff6c4e28a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableCell.php @@ -0,0 +1,186 @@ +google.cloud.documentai.v1.Document.Page.Table.TableCell + */ +class TableCell extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + */ + protected $row_span = 0; + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + */ + protected $col_span = 0; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + */ + private $detected_languages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + * @type int $row_span + * How many rows this cell spans. + * @type int $col_span + * How many columns this cell spans. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + * @return int + */ + public function getRowSpan() + { + return $this->row_span; + } + + /** + * How many rows this cell spans. + * + * Generated from protobuf field int32 row_span = 2; + * @param int $var + * @return $this + */ + public function setRowSpan($var) + { + GPBUtil::checkInt32($var); + $this->row_span = $var; + + return $this; + } + + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + * @return int + */ + public function getColSpan() + { + return $this->col_span; + } + + /** + * How many columns this cell spans. + * + * Generated from protobuf field int32 col_span = 3; + * @param int $var + * @return $this + */ + public function setColSpan($var) + { + GPBUtil::checkInt32($var); + $this->col_span = $var; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TableCell::class, \Google\Cloud\DocumentAI\V1\Document_Page_Table_TableCell::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableRow.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableRow.php new file mode 100644 index 000000000000..c3c865e0ea5a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableRow.php @@ -0,0 +1,70 @@ +google.cloud.documentai.v1.Document.Page.Table.TableRow + */ +class TableRow extends \Google\Protobuf\Internal\Message +{ + /** + * Cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; + */ + private $cells; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell>|\Google\Protobuf\Internal\RepeatedField $cells + * Cells that make up this row. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCells() + { + return $this->cells; + } + + /** + * Cells that make up this row. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCells($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell::class); + $this->cells = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TableRow::class, \Google\Cloud\DocumentAI\V1\Document_Page_Table_TableRow::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token.php new file mode 100644 index 000000000000..a373a99b3ab6 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token.php @@ -0,0 +1,261 @@ +google.cloud.documentai.v1.Document.Page.Token + */ +class Token extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Token][google.cloud.documentai.v1.Document.Page.Token]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; + */ + protected $detected_break = null; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; + */ + private $detected_languages; + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 4 [deprecated = true]; + * @deprecated + */ + protected $provenance = null; + /** + * Text style attributes. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.StyleInfo style_info = 5; + */ + protected $style_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Token][google.cloud.documentai.v1.Document.Page.Token]. + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak $detected_break + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance + * The history of this annotation. + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Token\StyleInfo $style_info + * Text style attributes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Token][google.cloud.documentai.v1.Document.Page.Token]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [Token][google.cloud.documentai.v1.Document.Page.Token]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak|null + */ + public function getDetectedBreak() + { + return $this->detected_break; + } + + public function hasDetectedBreak() + { + return isset($this->detected_break); + } + + public function clearDetectedBreak() + { + unset($this->detected_break); + } + + /** + * Detected break at the end of a + * [Token][google.cloud.documentai.v1.Document.Page.Token]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak $var + * @return $this + */ + public function setDetectedBreak($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak::class); + $this->detected_break = $var; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 4 [deprecated = true]; + * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null + * @deprecated + */ + public function getProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return $this->provenance; + } + + public function hasProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return isset($this->provenance); + } + + public function clearProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + unset($this->provenance); + } + + /** + * The history of this annotation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 4 [deprecated = true]; + * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var + * @return $this + * @deprecated + */ + public function setProvenance($var) + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $var; + + return $this; + } + + /** + * Text style attributes. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.StyleInfo style_info = 5; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Token\StyleInfo|null + */ + public function getStyleInfo() + { + return $this->style_info; + } + + public function hasStyleInfo() + { + return isset($this->style_info); + } + + public function clearStyleInfo() + { + unset($this->style_info); + } + + /** + * Text style attributes. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.StyleInfo style_info = 5; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Token\StyleInfo $var + * @return $this + */ + public function setStyleInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Token\StyleInfo::class); + $this->style_info = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Token::class, \Google\Cloud\DocumentAI\V1\Document_Page_Token::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak.php new file mode 100644 index 000000000000..d5fe06afd4f5 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak.php @@ -0,0 +1,71 @@ +google.cloud.documentai.v1.Document.Page.Token.DetectedBreak + */ +class DetectedBreak extends \Google\Protobuf\Internal\Message +{ + /** + * Detected break type. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Detected break type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Detected break type. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Detected break type. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak\Type::class); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DetectedBreak::class, \Google\Cloud\DocumentAI\V1\Document_Page_Token_DetectedBreak::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak/Type.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak/Type.php new file mode 100644 index 000000000000..79c8990b17fc --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak/Type.php @@ -0,0 +1,71 @@ +google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type + */ +class Type +{ + /** + * Unspecified break type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * A single whitespace. + * + * Generated from protobuf enum SPACE = 1; + */ + const SPACE = 1; + /** + * A wider whitespace. + * + * Generated from protobuf enum WIDE_SPACE = 2; + */ + const WIDE_SPACE = 2; + /** + * A hyphen that indicates that a token has been split across lines. + * + * Generated from protobuf enum HYPHEN = 3; + */ + const HYPHEN = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::SPACE => 'SPACE', + self::WIDE_SPACE => 'WIDE_SPACE', + self::HYPHEN => 'HYPHEN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\DocumentAI\V1\Document_Page_Token_DetectedBreak_Type::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/StyleInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/StyleInfo.php new file mode 100644 index 000000000000..e696a8fffcf1 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/StyleInfo.php @@ -0,0 +1,586 @@ +google.cloud.documentai.v1.Document.Page.Token.StyleInfo + */ +class StyleInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Font size in points (`1` point is `¹⁄₇₂` inches). + * + * Generated from protobuf field int32 font_size = 1; + */ + protected $font_size = 0; + /** + * Font size in pixels, equal to _unrounded + * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + * * _resolution_ ÷ `72.0`. + * + * Generated from protobuf field double pixel_font_size = 2; + */ + protected $pixel_font_size = 0.0; + /** + * Letter spacing in points. + * + * Generated from protobuf field double letter_spacing = 3; + */ + protected $letter_spacing = 0.0; + /** + * Name or style of the font. + * + * Generated from protobuf field string font_type = 4; + */ + protected $font_type = ''; + /** + * Whether the text is bold (equivalent to + * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + * is at least `700`). + * + * Generated from protobuf field bool bold = 5; + */ + protected $bold = false; + /** + * Whether the text is italic. + * + * Generated from protobuf field bool italic = 6; + */ + protected $italic = false; + /** + * Whether the text is underlined. + * + * Generated from protobuf field bool underlined = 7; + */ + protected $underlined = false; + /** + * Whether the text is strikethrough. This feature is not supported yet. + * + * Generated from protobuf field bool strikeout = 8; + */ + protected $strikeout = false; + /** + * Whether the text is a subscript. This feature is not supported yet. + * + * Generated from protobuf field bool subscript = 9; + */ + protected $subscript = false; + /** + * Whether the text is a superscript. This feature is not supported yet. + * + * Generated from protobuf field bool superscript = 10; + */ + protected $superscript = false; + /** + * Whether the text is in small caps. This feature is not supported yet. + * + * Generated from protobuf field bool smallcaps = 11; + */ + protected $smallcaps = false; + /** + * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). + * Normal is `400`, bold is `700`. + * + * Generated from protobuf field int32 font_weight = 12; + */ + protected $font_weight = 0; + /** + * Whether the text is handwritten. + * + * Generated from protobuf field bool handwritten = 13; + */ + protected $handwritten = false; + /** + * Color of the text. + * + * Generated from protobuf field .google.type.Color text_color = 14; + */ + protected $text_color = null; + /** + * Color of the background. + * + * Generated from protobuf field .google.type.Color background_color = 15; + */ + protected $background_color = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $font_size + * Font size in points (`1` point is `¹⁄₇₂` inches). + * @type float $pixel_font_size + * Font size in pixels, equal to _unrounded + * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + * * _resolution_ ÷ `72.0`. + * @type float $letter_spacing + * Letter spacing in points. + * @type string $font_type + * Name or style of the font. + * @type bool $bold + * Whether the text is bold (equivalent to + * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + * is at least `700`). + * @type bool $italic + * Whether the text is italic. + * @type bool $underlined + * Whether the text is underlined. + * @type bool $strikeout + * Whether the text is strikethrough. This feature is not supported yet. + * @type bool $subscript + * Whether the text is a subscript. This feature is not supported yet. + * @type bool $superscript + * Whether the text is a superscript. This feature is not supported yet. + * @type bool $smallcaps + * Whether the text is in small caps. This feature is not supported yet. + * @type int $font_weight + * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). + * Normal is `400`, bold is `700`. + * @type bool $handwritten + * Whether the text is handwritten. + * @type \Google\Type\Color $text_color + * Color of the text. + * @type \Google\Type\Color $background_color + * Color of the background. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Font size in points (`1` point is `¹⁄₇₂` inches). + * + * Generated from protobuf field int32 font_size = 1; + * @return int + */ + public function getFontSize() + { + return $this->font_size; + } + + /** + * Font size in points (`1` point is `¹⁄₇₂` inches). + * + * Generated from protobuf field int32 font_size = 1; + * @param int $var + * @return $this + */ + public function setFontSize($var) + { + GPBUtil::checkInt32($var); + $this->font_size = $var; + + return $this; + } + + /** + * Font size in pixels, equal to _unrounded + * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + * * _resolution_ ÷ `72.0`. + * + * Generated from protobuf field double pixel_font_size = 2; + * @return float + */ + public function getPixelFontSize() + { + return $this->pixel_font_size; + } + + /** + * Font size in pixels, equal to _unrounded + * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ + * * _resolution_ ÷ `72.0`. + * + * Generated from protobuf field double pixel_font_size = 2; + * @param float $var + * @return $this + */ + public function setPixelFontSize($var) + { + GPBUtil::checkDouble($var); + $this->pixel_font_size = $var; + + return $this; + } + + /** + * Letter spacing in points. + * + * Generated from protobuf field double letter_spacing = 3; + * @return float + */ + public function getLetterSpacing() + { + return $this->letter_spacing; + } + + /** + * Letter spacing in points. + * + * Generated from protobuf field double letter_spacing = 3; + * @param float $var + * @return $this + */ + public function setLetterSpacing($var) + { + GPBUtil::checkDouble($var); + $this->letter_spacing = $var; + + return $this; + } + + /** + * Name or style of the font. + * + * Generated from protobuf field string font_type = 4; + * @return string + */ + public function getFontType() + { + return $this->font_type; + } + + /** + * Name or style of the font. + * + * Generated from protobuf field string font_type = 4; + * @param string $var + * @return $this + */ + public function setFontType($var) + { + GPBUtil::checkString($var, True); + $this->font_type = $var; + + return $this; + } + + /** + * Whether the text is bold (equivalent to + * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + * is at least `700`). + * + * Generated from protobuf field bool bold = 5; + * @return bool + */ + public function getBold() + { + return $this->bold; + } + + /** + * Whether the text is bold (equivalent to + * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] + * is at least `700`). + * + * Generated from protobuf field bool bold = 5; + * @param bool $var + * @return $this + */ + public function setBold($var) + { + GPBUtil::checkBool($var); + $this->bold = $var; + + return $this; + } + + /** + * Whether the text is italic. + * + * Generated from protobuf field bool italic = 6; + * @return bool + */ + public function getItalic() + { + return $this->italic; + } + + /** + * Whether the text is italic. + * + * Generated from protobuf field bool italic = 6; + * @param bool $var + * @return $this + */ + public function setItalic($var) + { + GPBUtil::checkBool($var); + $this->italic = $var; + + return $this; + } + + /** + * Whether the text is underlined. + * + * Generated from protobuf field bool underlined = 7; + * @return bool + */ + public function getUnderlined() + { + return $this->underlined; + } + + /** + * Whether the text is underlined. + * + * Generated from protobuf field bool underlined = 7; + * @param bool $var + * @return $this + */ + public function setUnderlined($var) + { + GPBUtil::checkBool($var); + $this->underlined = $var; + + return $this; + } + + /** + * Whether the text is strikethrough. This feature is not supported yet. + * + * Generated from protobuf field bool strikeout = 8; + * @return bool + */ + public function getStrikeout() + { + return $this->strikeout; + } + + /** + * Whether the text is strikethrough. This feature is not supported yet. + * + * Generated from protobuf field bool strikeout = 8; + * @param bool $var + * @return $this + */ + public function setStrikeout($var) + { + GPBUtil::checkBool($var); + $this->strikeout = $var; + + return $this; + } + + /** + * Whether the text is a subscript. This feature is not supported yet. + * + * Generated from protobuf field bool subscript = 9; + * @return bool + */ + public function getSubscript() + { + return $this->subscript; + } + + /** + * Whether the text is a subscript. This feature is not supported yet. + * + * Generated from protobuf field bool subscript = 9; + * @param bool $var + * @return $this + */ + public function setSubscript($var) + { + GPBUtil::checkBool($var); + $this->subscript = $var; + + return $this; + } + + /** + * Whether the text is a superscript. This feature is not supported yet. + * + * Generated from protobuf field bool superscript = 10; + * @return bool + */ + public function getSuperscript() + { + return $this->superscript; + } + + /** + * Whether the text is a superscript. This feature is not supported yet. + * + * Generated from protobuf field bool superscript = 10; + * @param bool $var + * @return $this + */ + public function setSuperscript($var) + { + GPBUtil::checkBool($var); + $this->superscript = $var; + + return $this; + } + + /** + * Whether the text is in small caps. This feature is not supported yet. + * + * Generated from protobuf field bool smallcaps = 11; + * @return bool + */ + public function getSmallcaps() + { + return $this->smallcaps; + } + + /** + * Whether the text is in small caps. This feature is not supported yet. + * + * Generated from protobuf field bool smallcaps = 11; + * @param bool $var + * @return $this + */ + public function setSmallcaps($var) + { + GPBUtil::checkBool($var); + $this->smallcaps = $var; + + return $this; + } + + /** + * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). + * Normal is `400`, bold is `700`. + * + * Generated from protobuf field int32 font_weight = 12; + * @return int + */ + public function getFontWeight() + { + return $this->font_weight; + } + + /** + * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). + * Normal is `400`, bold is `700`. + * + * Generated from protobuf field int32 font_weight = 12; + * @param int $var + * @return $this + */ + public function setFontWeight($var) + { + GPBUtil::checkInt32($var); + $this->font_weight = $var; + + return $this; + } + + /** + * Whether the text is handwritten. + * + * Generated from protobuf field bool handwritten = 13; + * @return bool + */ + public function getHandwritten() + { + return $this->handwritten; + } + + /** + * Whether the text is handwritten. + * + * Generated from protobuf field bool handwritten = 13; + * @param bool $var + * @return $this + */ + public function setHandwritten($var) + { + GPBUtil::checkBool($var); + $this->handwritten = $var; + + return $this; + } + + /** + * Color of the text. + * + * Generated from protobuf field .google.type.Color text_color = 14; + * @return \Google\Type\Color|null + */ + public function getTextColor() + { + return $this->text_color; + } + + public function hasTextColor() + { + return isset($this->text_color); + } + + public function clearTextColor() + { + unset($this->text_color); + } + + /** + * Color of the text. + * + * Generated from protobuf field .google.type.Color text_color = 14; + * @param \Google\Type\Color $var + * @return $this + */ + public function setTextColor($var) + { + GPBUtil::checkMessage($var, \Google\Type\Color::class); + $this->text_color = $var; + + return $this; + } + + /** + * Color of the background. + * + * Generated from protobuf field .google.type.Color background_color = 15; + * @return \Google\Type\Color|null + */ + public function getBackgroundColor() + { + return $this->background_color; + } + + public function hasBackgroundColor() + { + return isset($this->background_color); + } + + public function clearBackgroundColor() + { + unset($this->background_color); + } + + /** + * Color of the background. + * + * Generated from protobuf field .google.type.Color background_color = 15; + * @param \Google\Type\Color $var + * @return $this + */ + public function setBackgroundColor($var) + { + GPBUtil::checkMessage($var, \Google\Type\Color::class); + $this->background_color = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StyleInfo::class, \Google\Cloud\DocumentAI\V1\Document_Page_Token_StyleInfo::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/VisualElement.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/VisualElement.php new file mode 100644 index 000000000000..ef372b3c73a9 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/VisualElement.php @@ -0,0 +1,157 @@ +google.cloud.documentai.v1.Document.Page.VisualElement + */ +class VisualElement extends \Google\Protobuf\Internal\Message +{ + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + */ + protected $layout = null; + /** + * Type of the + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * + * Generated from protobuf field string type = 2; + */ + protected $type = ''; + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; + */ + private $detected_languages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * @type string $type + * Type of the + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages + * A list of detected languages together with confidence. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null + */ + public function getLayout() + { + return $this->layout; + } + + public function hasLayout() + { + return isset($this->layout); + } + + public function clearLayout() + { + unset($this->layout); + } + + /** + * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); + $this->layout = $var; + + return $this; + } + + /** + * Type of the + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the + * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetectedLanguages() + { + return $this->detected_languages; + } + + /** + * A list of detected languages together with confidence. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetectedLanguages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); + $this->detected_languages = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VisualElement::class, \Google\Cloud\DocumentAI\V1\Document_Page_VisualElement::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor.php new file mode 100644 index 000000000000..34337ca820ce --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor.php @@ -0,0 +1,73 @@ +google.cloud.documentai.v1.Document.PageAnchor + */ +class PageAnchor extends \Google\Protobuf\Internal\Message +{ + /** + * One or more references to visual page elements + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; + */ + private $page_refs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef>|\Google\Protobuf\Internal\RepeatedField $page_refs + * One or more references to visual page elements + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * One or more references to visual page elements + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageRefs() + { + return $this->page_refs; + } + + /** + * One or more references to visual page elements + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageRefs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef::class); + $this->page_refs = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PageAnchor::class, \Google\Cloud\DocumentAI\V1\Document_PageAnchor::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef.php new file mode 100644 index 000000000000..13dbd61e2050 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef.php @@ -0,0 +1,265 @@ +google.cloud.documentai.v1.Document.PageAnchor.PageRef + */ +class PageRef extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Index into the + * [Document.pages][google.cloud.documentai.v1.Document.pages] element, + * for example using + * `[Document.pages][page_refs.page]` to locate the related page element. + * This field is skipped when its value is the default `0`. See + * https://developers.google.com/protocol-buffers/docs/proto3#json. + * + * Generated from protobuf field int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $page = 0; + /** + * Optional. The type of the layout element that is being referenced if + * any. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $layout_type = 0; + /** + * Optional. Deprecated. Use + * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + * instead. + * + * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $layout_id = ''; + /** + * Optional. Identifies the bounding polygon of a layout element on the + * page. If `layout_type` is set, the bounding polygon must be exactly the + * same to the layout element it's referring to. + * + * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $bounding_poly = null; + /** + * Optional. Confidence of detected page element, if applicable. Range + * `[0, 1]`. + * + * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $page + * Required. Index into the + * [Document.pages][google.cloud.documentai.v1.Document.pages] element, + * for example using + * `[Document.pages][page_refs.page]` to locate the related page element. + * This field is skipped when its value is the default `0`. See + * https://developers.google.com/protocol-buffers/docs/proto3#json. + * @type int $layout_type + * Optional. The type of the layout element that is being referenced if + * any. + * @type string $layout_id + * Optional. Deprecated. Use + * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + * instead. + * @type \Google\Cloud\DocumentAI\V1\BoundingPoly $bounding_poly + * Optional. Identifies the bounding polygon of a layout element on the + * page. If `layout_type` is set, the bounding polygon must be exactly the + * same to the layout element it's referring to. + * @type float $confidence + * Optional. Confidence of detected page element, if applicable. Range + * `[0, 1]`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Required. Index into the + * [Document.pages][google.cloud.documentai.v1.Document.pages] element, + * for example using + * `[Document.pages][page_refs.page]` to locate the related page element. + * This field is skipped when its value is the default `0`. See + * https://developers.google.com/protocol-buffers/docs/proto3#json. + * + * Generated from protobuf field int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getPage() + { + return $this->page; + } + + /** + * Required. Index into the + * [Document.pages][google.cloud.documentai.v1.Document.pages] element, + * for example using + * `[Document.pages][page_refs.page]` to locate the related page element. + * This field is skipped when its value is the default `0`. See + * https://developers.google.com/protocol-buffers/docs/proto3#json. + * + * Generated from protobuf field int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setPage($var) + { + GPBUtil::checkInt64($var); + $this->page = $var; + + return $this; + } + + /** + * Optional. The type of the layout element that is being referenced if + * any. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLayoutType() + { + return $this->layout_type; + } + + /** + * Optional. The type of the layout element that is being referenced if + * any. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLayoutType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef\LayoutType::class); + $this->layout_type = $var; + + return $this; + } + + /** + * Optional. Deprecated. Use + * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + * instead. + * + * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getLayoutId() + { + @trigger_error('layout_id is deprecated.', E_USER_DEPRECATED); + return $this->layout_id; + } + + /** + * Optional. Deprecated. Use + * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + * instead. + * + * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setLayoutId($var) + { + @trigger_error('layout_id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->layout_id = $var; + + return $this; + } + + /** + * Optional. Identifies the bounding polygon of a layout element on the + * page. If `layout_type` is set, the bounding polygon must be exactly the + * same to the layout element it's referring to. + * + * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\BoundingPoly|null + */ + public function getBoundingPoly() + { + return $this->bounding_poly; + } + + public function hasBoundingPoly() + { + return isset($this->bounding_poly); + } + + public function clearBoundingPoly() + { + unset($this->bounding_poly); + } + + /** + * Optional. Identifies the bounding polygon of a layout element on the + * page. If `layout_type` is set, the bounding polygon must be exactly the + * same to the layout element it's referring to. + * + * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\BoundingPoly $var + * @return $this + */ + public function setBoundingPoly($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BoundingPoly::class); + $this->bounding_poly = $var; + + return $this; + } + + /** + * Optional. Confidence of detected page element, if applicable. Range + * `[0, 1]`. + * + * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Optional. Confidence of detected page element, if applicable. Range + * `[0, 1]`. + * + * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PageRef::class, \Google\Cloud\DocumentAI\V1\Document_PageAnchor_PageRef::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef/LayoutType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef/LayoutType.php new file mode 100644 index 000000000000..59f60718b807 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef/LayoutType.php @@ -0,0 +1,112 @@ +google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType + */ +class LayoutType +{ + /** + * Layout Unspecified. + * + * Generated from protobuf enum LAYOUT_TYPE_UNSPECIFIED = 0; + */ + const LAYOUT_TYPE_UNSPECIFIED = 0; + /** + * References a + * [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] + * element. + * + * Generated from protobuf enum BLOCK = 1; + */ + const BLOCK = 1; + /** + * References a + * [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] + * element. + * + * Generated from protobuf enum PARAGRAPH = 2; + */ + const PARAGRAPH = 2; + /** + * References a + * [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. + * + * Generated from protobuf enum LINE = 3; + */ + const LINE = 3; + /** + * References a + * [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] + * element. + * + * Generated from protobuf enum TOKEN = 4; + */ + const TOKEN = 4; + /** + * References a + * [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] + * element. + * + * Generated from protobuf enum VISUAL_ELEMENT = 5; + */ + const VISUAL_ELEMENT = 5; + /** + * Refrrences a + * [Page.tables][google.cloud.documentai.v1.Document.Page.tables] + * element. + * + * Generated from protobuf enum TABLE = 6; + */ + const TABLE = 6; + /** + * References a + * [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] + * element. + * + * Generated from protobuf enum FORM_FIELD = 7; + */ + const FORM_FIELD = 7; + + private static $valueToName = [ + self::LAYOUT_TYPE_UNSPECIFIED => 'LAYOUT_TYPE_UNSPECIFIED', + self::BLOCK => 'BLOCK', + self::PARAGRAPH => 'PARAGRAPH', + self::LINE => 'LINE', + self::TOKEN => 'TOKEN', + self::VISUAL_ELEMENT => 'VISUAL_ELEMENT', + self::TABLE => 'TABLE', + self::FORM_FIELD => 'FORM_FIELD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutType::class, \Google\Cloud\DocumentAI\V1\Document_PageAnchor_PageRef_LayoutType::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance.php new file mode 100644 index 000000000000..862fada0a40b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance.php @@ -0,0 +1,187 @@ +google.cloud.documentai.v1.Document.Provenance + */ +class Provenance extends \Google\Protobuf\Internal\Message +{ + /** + * The index of the revision that produced this element. + * + * Generated from protobuf field int32 revision = 1 [deprecated = true]; + * @deprecated + */ + protected $revision = 0; + /** + * The Id of this operation. Needs to be unique within the scope of the + * revision. + * + * Generated from protobuf field int32 id = 2 [deprecated = true]; + * @deprecated + */ + protected $id = 0; + /** + * References to the original elements that are replaced. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance.Parent parents = 3; + */ + private $parents; + /** + * The type of provenance operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance.OperationType type = 4; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $revision + * The index of the revision that produced this element. + * @type int $id + * The Id of this operation. Needs to be unique within the scope of the + * revision. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Provenance\PBParent>|\Google\Protobuf\Internal\RepeatedField $parents + * References to the original elements that are replaced. + * @type int $type + * The type of provenance operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * The index of the revision that produced this element. + * + * Generated from protobuf field int32 revision = 1 [deprecated = true]; + * @return int + * @deprecated + */ + public function getRevision() + { + @trigger_error('revision is deprecated.', E_USER_DEPRECATED); + return $this->revision; + } + + /** + * The index of the revision that produced this element. + * + * Generated from protobuf field int32 revision = 1 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setRevision($var) + { + @trigger_error('revision is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkInt32($var); + $this->revision = $var; + + return $this; + } + + /** + * The Id of this operation. Needs to be unique within the scope of the + * revision. + * + * Generated from protobuf field int32 id = 2 [deprecated = true]; + * @return int + * @deprecated + */ + public function getId() + { + @trigger_error('id is deprecated.', E_USER_DEPRECATED); + return $this->id; + } + + /** + * The Id of this operation. Needs to be unique within the scope of the + * revision. + * + * Generated from protobuf field int32 id = 2 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setId($var) + { + @trigger_error('id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkInt32($var); + $this->id = $var; + + return $this; + } + + /** + * References to the original elements that are replaced. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance.Parent parents = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParents() + { + return $this->parents; + } + + /** + * References to the original elements that are replaced. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance.Parent parents = 3; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Provenance\PBParent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Provenance\PBParent::class); + $this->parents = $arr; + + return $this; + } + + /** + * The type of provenance operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance.OperationType type = 4; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of provenance operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance.OperationType type = 4; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\Provenance\OperationType::class); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Provenance::class, \Google\Cloud\DocumentAI\V1\Document_Provenance::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/OperationType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/OperationType.php new file mode 100644 index 000000000000..ff615ad82354 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/OperationType.php @@ -0,0 +1,105 @@ +google.cloud.documentai.v1.Document.Provenance.OperationType + */ +class OperationType +{ + /** + * Operation type unspecified. If no operation is specified a provenance + * entry is simply used to match against a `parent`. + * + * Generated from protobuf enum OPERATION_TYPE_UNSPECIFIED = 0; + */ + const OPERATION_TYPE_UNSPECIFIED = 0; + /** + * Add an element. + * + * Generated from protobuf enum ADD = 1; + */ + const ADD = 1; + /** + * Remove an element identified by `parent`. + * + * Generated from protobuf enum REMOVE = 2; + */ + const REMOVE = 2; + /** + * Updates any fields within the given provenance scope of the message. It + * overwrites the fields rather than replacing them. Use this when you + * want to update a field value of an entity without also updating all the + * child properties. + * + * Generated from protobuf enum UPDATE = 7; + */ + const UPDATE = 7; + /** + * Currently unused. Replace an element identified by `parent`. + * + * Generated from protobuf enum REPLACE = 3; + */ + const REPLACE = 3; + /** + * Deprecated. Request human review for the element identified by + * `parent`. + * + * Generated from protobuf enum EVAL_REQUESTED = 4 [deprecated = true]; + */ + const EVAL_REQUESTED = 4; + /** + * Deprecated. Element is reviewed and approved at human review, + * confidence will be set to 1.0. + * + * Generated from protobuf enum EVAL_APPROVED = 5 [deprecated = true]; + */ + const EVAL_APPROVED = 5; + /** + * Deprecated. Element is skipped in the validation process. + * + * Generated from protobuf enum EVAL_SKIPPED = 6 [deprecated = true]; + */ + const EVAL_SKIPPED = 6; + + private static $valueToName = [ + self::OPERATION_TYPE_UNSPECIFIED => 'OPERATION_TYPE_UNSPECIFIED', + self::ADD => 'ADD', + self::REMOVE => 'REMOVE', + self::UPDATE => 'UPDATE', + self::REPLACE => 'REPLACE', + self::EVAL_REQUESTED => 'EVAL_REQUESTED', + self::EVAL_APPROVED => 'EVAL_APPROVED', + self::EVAL_SKIPPED => 'EVAL_SKIPPED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OperationType::class, \Google\Cloud\DocumentAI\V1\Document_Provenance_OperationType::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/PBParent.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/PBParent.php new file mode 100644 index 000000000000..97dcd6f8da2f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/PBParent.php @@ -0,0 +1,148 @@ +google.cloud.documentai.v1.Document.Provenance.Parent + */ +class PBParent extends \Google\Protobuf\Internal\Message +{ + /** + * The index of the index into current revision's parent_ids list. + * + * Generated from protobuf field int32 revision = 1; + */ + protected $revision = 0; + /** + * The index of the parent item in the corresponding item list (eg. list + * of entities, properties within entities, etc.) in the parent revision. + * + * Generated from protobuf field int32 index = 3; + */ + protected $index = 0; + /** + * The id of the parent provenance. + * + * Generated from protobuf field int32 id = 2 [deprecated = true]; + * @deprecated + */ + protected $id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $revision + * The index of the index into current revision's parent_ids list. + * @type int $index + * The index of the parent item in the corresponding item list (eg. list + * of entities, properties within entities, etc.) in the parent revision. + * @type int $id + * The id of the parent provenance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * The index of the index into current revision's parent_ids list. + * + * Generated from protobuf field int32 revision = 1; + * @return int + */ + public function getRevision() + { + return $this->revision; + } + + /** + * The index of the index into current revision's parent_ids list. + * + * Generated from protobuf field int32 revision = 1; + * @param int $var + * @return $this + */ + public function setRevision($var) + { + GPBUtil::checkInt32($var); + $this->revision = $var; + + return $this; + } + + /** + * The index of the parent item in the corresponding item list (eg. list + * of entities, properties within entities, etc.) in the parent revision. + * + * Generated from protobuf field int32 index = 3; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index of the parent item in the corresponding item list (eg. list + * of entities, properties within entities, etc.) in the parent revision. + * + * Generated from protobuf field int32 index = 3; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * The id of the parent provenance. + * + * Generated from protobuf field int32 id = 2 [deprecated = true]; + * @return int + * @deprecated + */ + public function getId() + { + @trigger_error('id is deprecated.', E_USER_DEPRECATED); + return $this->id; + } + + /** + * The id of the parent provenance. + * + * Generated from protobuf field int32 id = 2 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setId($var) + { + @trigger_error('id is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkInt32($var); + $this->id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBParent::class, \Google\Cloud\DocumentAI\V1\Document_Provenance_Parent::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision.php new file mode 100644 index 000000000000..ba22c0925a33 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision.php @@ -0,0 +1,336 @@ +google.cloud.documentai.v1.Document.Revision + */ +class Revision extends \Google\Protobuf\Internal\Message +{ + /** + * Id of the revision, internally generated by doc proto storage. + * Unique within the context of the document. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * The revisions that this revision is based on. This can include one or + * more parent (when documents are merged.) This field represents the + * index into the `revisions` field. + * + * Generated from protobuf field repeated int32 parent = 2 [deprecated = true]; + * @deprecated + */ + private $parent; + /** + * The revisions that this revision is based on. Must include all the ids + * that have anything to do with this revision - eg. there are + * `provenance.parent.revision` fields that index into this field. + * + * Generated from protobuf field repeated string parent_ids = 7; + */ + private $parent_ids; + /** + * The time that the revision was created, internally generated by + * doc proto storage at the time of create. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * Human Review information of this revision. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6; + */ + protected $human_review = null; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $agent + * If the change was made by a person specify the name or id of that + * person. + * @type string $processor + * If the annotation was made by processor identify the processor by its + * resource name. + * @type string $id + * Id of the revision, internally generated by doc proto storage. + * Unique within the context of the document. + * @type array|\Google\Protobuf\Internal\RepeatedField $parent + * The revisions that this revision is based on. This can include one or + * more parent (when documents are merged.) This field represents the + * index into the `revisions` field. + * @type array|\Google\Protobuf\Internal\RepeatedField $parent_ids + * The revisions that this revision is based on. Must include all the ids + * that have anything to do with this revision - eg. there are + * `provenance.parent.revision` fields that index into this field. + * @type \Google\Protobuf\Timestamp $create_time + * The time that the revision was created, internally generated by + * doc proto storage at the time of create. + * @type \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview $human_review + * Human Review information of this revision. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * If the change was made by a person specify the name or id of that + * person. + * + * Generated from protobuf field string agent = 4; + * @return string + */ + public function getAgent() + { + return $this->readOneof(4); + } + + public function hasAgent() + { + return $this->hasOneof(4); + } + + /** + * If the change was made by a person specify the name or id of that + * person. + * + * Generated from protobuf field string agent = 4; + * @param string $var + * @return $this + */ + public function setAgent($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * If the annotation was made by processor identify the processor by its + * resource name. + * + * Generated from protobuf field string processor = 5; + * @return string + */ + public function getProcessor() + { + return $this->readOneof(5); + } + + public function hasProcessor() + { + return $this->hasOneof(5); + } + + /** + * If the annotation was made by processor identify the processor by its + * resource name. + * + * Generated from protobuf field string processor = 5; + * @param string $var + * @return $this + */ + public function setProcessor($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Id of the revision, internally generated by doc proto storage. + * Unique within the context of the document. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Id of the revision, internally generated by doc proto storage. + * Unique within the context of the document. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The revisions that this revision is based on. This can include one or + * more parent (when documents are merged.) This field represents the + * index into the `revisions` field. + * + * Generated from protobuf field repeated int32 parent = 2 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getParent() + { + @trigger_error('parent is deprecated.', E_USER_DEPRECATED); + return $this->parent; + } + + /** + * The revisions that this revision is based on. This can include one or + * more parent (when documents are merged.) This field represents the + * index into the `revisions` field. + * + * Generated from protobuf field repeated int32 parent = 2 [deprecated = true]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setParent($var) + { + @trigger_error('parent is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->parent = $arr; + + return $this; + } + + /** + * The revisions that this revision is based on. Must include all the ids + * that have anything to do with this revision - eg. there are + * `provenance.parent.revision` fields that index into this field. + * + * Generated from protobuf field repeated string parent_ids = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParentIds() + { + return $this->parent_ids; + } + + /** + * The revisions that this revision is based on. Must include all the ids + * that have anything to do with this revision - eg. there are + * `provenance.parent.revision` fields that index into this field. + * + * Generated from protobuf field repeated string parent_ids = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParentIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->parent_ids = $arr; + + return $this; + } + + /** + * The time that the revision was created, internally generated by + * doc proto storage at the time of create. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time that the revision was created, internally generated by + * doc proto storage at the time of create. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Human Review information of this revision. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6; + * @return \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview|null + */ + public function getHumanReview() + { + return $this->human_review; + } + + public function hasHumanReview() + { + return isset($this->human_review); + } + + public function clearHumanReview() + { + unset($this->human_review); + } + + /** + * Human Review information of this revision. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6; + * @param \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview $var + * @return $this + */ + public function setHumanReview($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview::class); + $this->human_review = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Revision::class, \Google\Cloud\DocumentAI\V1\Document_Revision::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision/HumanReview.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision/HumanReview.php new file mode 100644 index 000000000000..5ed97f0bafa3 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision/HumanReview.php @@ -0,0 +1,108 @@ +google.cloud.documentai.v1.Document.Revision.HumanReview + */ +class HumanReview extends \Google\Protobuf\Internal\Message +{ + /** + * Human review state. e.g. `requested`, `succeeded`, `rejected`. + * + * Generated from protobuf field string state = 1; + */ + protected $state = ''; + /** + * A message providing more details about the current state of processing. + * For example, the rejection reason when the state is `rejected`. + * + * Generated from protobuf field string state_message = 2; + */ + protected $state_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $state + * Human review state. e.g. `requested`, `succeeded`, `rejected`. + * @type string $state_message + * A message providing more details about the current state of processing. + * For example, the rejection reason when the state is `rejected`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Human review state. e.g. `requested`, `succeeded`, `rejected`. + * + * Generated from protobuf field string state = 1; + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * Human review state. e.g. `requested`, `succeeded`, `rejected`. + * + * Generated from protobuf field string state = 1; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * A message providing more details about the current state of processing. + * For example, the rejection reason when the state is `rejected`. + * + * Generated from protobuf field string state_message = 2; + * @return string + */ + public function getStateMessage() + { + return $this->state_message; + } + + /** + * A message providing more details about the current state of processing. + * For example, the rejection reason when the state is `rejected`. + * + * Generated from protobuf field string state_message = 2; + * @param string $var + * @return $this + */ + public function setStateMessage($var) + { + GPBUtil::checkString($var, True); + $this->state_message = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HumanReview::class, \Google\Cloud\DocumentAI\V1\Document_Revision_HumanReview::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ShardInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ShardInfo.php new file mode 100644 index 000000000000..6d9bb1f585f0 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ShardInfo.php @@ -0,0 +1,148 @@ +google.cloud.documentai.v1.Document.ShardInfo + */ +class ShardInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The 0-based index of this shard. + * + * Generated from protobuf field int64 shard_index = 1; + */ + protected $shard_index = 0; + /** + * Total number of shards. + * + * Generated from protobuf field int64 shard_count = 2; + */ + protected $shard_count = 0; + /** + * The index of the first character in + * [Document.text][google.cloud.documentai.v1.Document.text] in the overall + * document global text. + * + * Generated from protobuf field int64 text_offset = 3; + */ + protected $text_offset = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $shard_index + * The 0-based index of this shard. + * @type int|string $shard_count + * Total number of shards. + * @type int|string $text_offset + * The index of the first character in + * [Document.text][google.cloud.documentai.v1.Document.text] in the overall + * document global text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * The 0-based index of this shard. + * + * Generated from protobuf field int64 shard_index = 1; + * @return int|string + */ + public function getShardIndex() + { + return $this->shard_index; + } + + /** + * The 0-based index of this shard. + * + * Generated from protobuf field int64 shard_index = 1; + * @param int|string $var + * @return $this + */ + public function setShardIndex($var) + { + GPBUtil::checkInt64($var); + $this->shard_index = $var; + + return $this; + } + + /** + * Total number of shards. + * + * Generated from protobuf field int64 shard_count = 2; + * @return int|string + */ + public function getShardCount() + { + return $this->shard_count; + } + + /** + * Total number of shards. + * + * Generated from protobuf field int64 shard_count = 2; + * @param int|string $var + * @return $this + */ + public function setShardCount($var) + { + GPBUtil::checkInt64($var); + $this->shard_count = $var; + + return $this; + } + + /** + * The index of the first character in + * [Document.text][google.cloud.documentai.v1.Document.text] in the overall + * document global text. + * + * Generated from protobuf field int64 text_offset = 3; + * @return int|string + */ + public function getTextOffset() + { + return $this->text_offset; + } + + /** + * The index of the first character in + * [Document.text][google.cloud.documentai.v1.Document.text] in the overall + * document global text. + * + * Generated from protobuf field int64 text_offset = 3; + * @param int|string $var + * @return $this + */ + public function setTextOffset($var) + { + GPBUtil::checkInt64($var); + $this->text_offset = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ShardInfo::class, \Google\Cloud\DocumentAI\V1\Document_ShardInfo::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style.php new file mode 100644 index 000000000000..919a62161e39 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style.php @@ -0,0 +1,377 @@ +google.cloud.documentai.v1.Document.Style + */ +class Style extends \Google\Protobuf\Internal\Message +{ + /** + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + protected $text_anchor = null; + /** + * Text color. + * + * Generated from protobuf field .google.type.Color color = 2; + */ + protected $color = null; + /** + * Text background color. + * + * Generated from protobuf field .google.type.Color background_color = 3; + */ + protected $background_color = null; + /** + * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). + * Possible values are `normal`, `bold`, `bolder`, and `lighter`. + * + * Generated from protobuf field string font_weight = 4; + */ + protected $font_weight = ''; + /** + * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). + * Possible values are `normal`, `italic`, and `oblique`. + * + * Generated from protobuf field string text_style = 5; + */ + protected $text_style = ''; + /** + * [Text + * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). + * Follows CSS standard. + * + * + * Generated from protobuf field string text_decoration = 6; + */ + protected $text_decoration = ''; + /** + * Font size. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + */ + protected $font_size = null; + /** + * Font family such as `Arial`, `Times New Roman`. + * https://www.w3schools.com/cssref/pr_font_font-family.asp + * + * Generated from protobuf field string font_family = 8; + */ + protected $font_family = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * @type \Google\Type\Color $color + * Text color. + * @type \Google\Type\Color $background_color + * Text background color. + * @type string $font_weight + * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). + * Possible values are `normal`, `bold`, `bolder`, and `lighter`. + * @type string $text_style + * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). + * Possible values are `normal`, `italic`, and `oblique`. + * @type string $text_decoration + * [Text + * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). + * Follows CSS standard. + * + * @type \Google\Cloud\DocumentAI\V1\Document\Style\FontSize $font_size + * Font size. + * @type string $font_family + * Font family such as `Arial`, `Times New Roman`. + * https://www.w3schools.com/cssref/pr_font_font-family.asp + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null + */ + public function getTextAnchor() + { + return $this->text_anchor; + } + + public function hasTextAnchor() + { + return isset($this->text_anchor); + } + + public function clearTextAnchor() + { + unset($this->text_anchor); + } + + /** + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var + * @return $this + */ + public function setTextAnchor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\TextAnchor::class); + $this->text_anchor = $var; + + return $this; + } + + /** + * Text color. + * + * Generated from protobuf field .google.type.Color color = 2; + * @return \Google\Type\Color|null + */ + public function getColor() + { + return $this->color; + } + + public function hasColor() + { + return isset($this->color); + } + + public function clearColor() + { + unset($this->color); + } + + /** + * Text color. + * + * Generated from protobuf field .google.type.Color color = 2; + * @param \Google\Type\Color $var + * @return $this + */ + public function setColor($var) + { + GPBUtil::checkMessage($var, \Google\Type\Color::class); + $this->color = $var; + + return $this; + } + + /** + * Text background color. + * + * Generated from protobuf field .google.type.Color background_color = 3; + * @return \Google\Type\Color|null + */ + public function getBackgroundColor() + { + return $this->background_color; + } + + public function hasBackgroundColor() + { + return isset($this->background_color); + } + + public function clearBackgroundColor() + { + unset($this->background_color); + } + + /** + * Text background color. + * + * Generated from protobuf field .google.type.Color background_color = 3; + * @param \Google\Type\Color $var + * @return $this + */ + public function setBackgroundColor($var) + { + GPBUtil::checkMessage($var, \Google\Type\Color::class); + $this->background_color = $var; + + return $this; + } + + /** + * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). + * Possible values are `normal`, `bold`, `bolder`, and `lighter`. + * + * Generated from protobuf field string font_weight = 4; + * @return string + */ + public function getFontWeight() + { + return $this->font_weight; + } + + /** + * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). + * Possible values are `normal`, `bold`, `bolder`, and `lighter`. + * + * Generated from protobuf field string font_weight = 4; + * @param string $var + * @return $this + */ + public function setFontWeight($var) + { + GPBUtil::checkString($var, True); + $this->font_weight = $var; + + return $this; + } + + /** + * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). + * Possible values are `normal`, `italic`, and `oblique`. + * + * Generated from protobuf field string text_style = 5; + * @return string + */ + public function getTextStyle() + { + return $this->text_style; + } + + /** + * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). + * Possible values are `normal`, `italic`, and `oblique`. + * + * Generated from protobuf field string text_style = 5; + * @param string $var + * @return $this + */ + public function setTextStyle($var) + { + GPBUtil::checkString($var, True); + $this->text_style = $var; + + return $this; + } + + /** + * [Text + * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). + * Follows CSS standard. + * + * + * Generated from protobuf field string text_decoration = 6; + * @return string + */ + public function getTextDecoration() + { + return $this->text_decoration; + } + + /** + * [Text + * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). + * Follows CSS standard. + * + * + * Generated from protobuf field string text_decoration = 6; + * @param string $var + * @return $this + */ + public function setTextDecoration($var) + { + GPBUtil::checkString($var, True); + $this->text_decoration = $var; + + return $this; + } + + /** + * Font size. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + * @return \Google\Cloud\DocumentAI\V1\Document\Style\FontSize|null + */ + public function getFontSize() + { + return $this->font_size; + } + + public function hasFontSize() + { + return isset($this->font_size); + } + + public function clearFontSize() + { + unset($this->font_size); + } + + /** + * Font size. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; + * @param \Google\Cloud\DocumentAI\V1\Document\Style\FontSize $var + * @return $this + */ + public function setFontSize($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Style\FontSize::class); + $this->font_size = $var; + + return $this; + } + + /** + * Font family such as `Arial`, `Times New Roman`. + * https://www.w3schools.com/cssref/pr_font_font-family.asp + * + * Generated from protobuf field string font_family = 8; + * @return string + */ + public function getFontFamily() + { + return $this->font_family; + } + + /** + * Font family such as `Arial`, `Times New Roman`. + * https://www.w3schools.com/cssref/pr_font_font-family.asp + * + * Generated from protobuf field string font_family = 8; + * @param string $var + * @return $this + */ + public function setFontFamily($var) + { + GPBUtil::checkString($var, True); + $this->font_family = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Style::class, \Google\Cloud\DocumentAI\V1\Document_Style::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style/FontSize.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style/FontSize.php new file mode 100644 index 000000000000..0df1bbb3866b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style/FontSize.php @@ -0,0 +1,108 @@ +google.cloud.documentai.v1.Document.Style.FontSize + */ +class FontSize extends \Google\Protobuf\Internal\Message +{ + /** + * Font size for the text. + * + * Generated from protobuf field float size = 1; + */ + protected $size = 0.0; + /** + * Unit for the font size. Follows CSS naming (such as `in`, `px`, and + * `pt`). + * + * Generated from protobuf field string unit = 2; + */ + protected $unit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $size + * Font size for the text. + * @type string $unit + * Unit for the font size. Follows CSS naming (such as `in`, `px`, and + * `pt`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Font size for the text. + * + * Generated from protobuf field float size = 1; + * @return float + */ + public function getSize() + { + return $this->size; + } + + /** + * Font size for the text. + * + * Generated from protobuf field float size = 1; + * @param float $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkFloat($var); + $this->size = $var; + + return $this; + } + + /** + * Unit for the font size. Follows CSS naming (such as `in`, `px`, and + * `pt`). + * + * Generated from protobuf field string unit = 2; + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * Unit for the font size. Follows CSS naming (such as `in`, `px`, and + * `pt`). + * + * Generated from protobuf field string unit = 2; + * @param string $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkString($var, True); + $this->unit = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FontSize::class, \Google\Cloud\DocumentAI\V1\Document_Style_FontSize::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor.php new file mode 100644 index 000000000000..d0ae3fa3ca95 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor.php @@ -0,0 +1,117 @@ +google.cloud.documentai.v1.Document.TextAnchor + */ +class TextAnchor extends \Google\Protobuf\Internal\Message +{ + /** + * The text segments from the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; + */ + private $text_segments; + /** + * Contains the content of the text span so that users do + * not have to look it up in the text_segments. It is always + * populated for formFields. + * + * Generated from protobuf field string content = 2; + */ + protected $content = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Document\TextAnchor\TextSegment>|\Google\Protobuf\Internal\RepeatedField $text_segments + * The text segments from the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * @type string $content + * Contains the content of the text span so that users do + * not have to look it up in the text_segments. It is always + * populated for formFields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * The text segments from the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTextSegments() + { + return $this->text_segments; + } + + /** + * The text segments from the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Document\TextAnchor\TextSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTextSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\TextAnchor\TextSegment::class); + $this->text_segments = $arr; + + return $this; + } + + /** + * Contains the content of the text span so that users do + * not have to look it up in the text_segments. It is always + * populated for formFields. + * + * Generated from protobuf field string content = 2; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Contains the content of the text span so that users do + * not have to look it up in the text_segments. It is always + * populated for formFields. + * + * Generated from protobuf field string content = 2; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TextAnchor::class, \Google\Cloud\DocumentAI\V1\Document_TextAnchor::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor/TextSegment.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor/TextSegment.php new file mode 100644 index 000000000000..7f67fa87c9e7 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor/TextSegment.php @@ -0,0 +1,124 @@ +google.cloud.documentai.v1.Document.TextAnchor.TextSegment + */ +class TextSegment extends \Google\Protobuf\Internal\Message +{ + /** + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * start UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field int64 start_index = 1; + */ + protected $start_index = 0; + /** + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * half open end UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field int64 end_index = 2; + */ + protected $end_index = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $start_index + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * start UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * @type int|string $end_index + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * half open end UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * start UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field int64 start_index = 1; + * @return int|string + */ + public function getStartIndex() + { + return $this->start_index; + } + + /** + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * start UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field int64 start_index = 1; + * @param int|string $var + * @return $this + */ + public function setStartIndex($var) + { + GPBUtil::checkInt64($var); + $this->start_index = $var; + + return $this; + } + + /** + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * half open end UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field int64 end_index = 2; + * @return int|string + */ + public function getEndIndex() + { + return $this->end_index; + } + + /** + * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + * half open end UTF-8 char index in the + * [Document.text][google.cloud.documentai.v1.Document.text]. + * + * Generated from protobuf field int64 end_index = 2; + * @param int|string $var + * @return $this + */ + public function setEndIndex($var) + { + GPBUtil::checkInt64($var); + $this->end_index = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TextSegment::class, \Google\Cloud\DocumentAI\V1\Document_TextAnchor_TextSegment::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextChange.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextChange.php new file mode 100644 index 000000000000..ed6ad16e5623 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextChange.php @@ -0,0 +1,173 @@ +google.cloud.documentai.v1.Document.TextChange + */ +class TextChange extends \Google\Protobuf\Internal\Message +{ + /** + * Provenance of the correction. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. There can + * only be a single `TextAnchor.text_segments` element. If the start and + * end index of the text segment are the same, the text change is inserted + * before that index. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + */ + protected $text_anchor = null; + /** + * The text that replaces the text identified in the `text_anchor`. + * + * Generated from protobuf field string changed_text = 2; + */ + protected $changed_text = ''; + /** + * The history of this annotation. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @deprecated + */ + private $provenance; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor + * Provenance of the correction. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. There can + * only be a single `TextAnchor.text_segments` element. If the start and + * end index of the text segment are the same, the text change is inserted + * before that index. + * @type string $changed_text + * The text that replaces the text identified in the `text_anchor`. + * @type array<\Google\Cloud\DocumentAI\V1\Document\Provenance>|\Google\Protobuf\Internal\RepeatedField $provenance + * The history of this annotation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Provenance of the correction. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. There can + * only be a single `TextAnchor.text_segments` element. If the start and + * end index of the text segment are the same, the text change is inserted + * before that index. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null + */ + public function getTextAnchor() + { + return $this->text_anchor; + } + + public function hasTextAnchor() + { + return isset($this->text_anchor); + } + + public function clearTextAnchor() + { + unset($this->text_anchor); + } + + /** + * Provenance of the correction. + * Text anchor indexing into the + * [Document.text][google.cloud.documentai.v1.Document.text]. There can + * only be a single `TextAnchor.text_segments` element. If the start and + * end index of the text segment are the same, the text change is inserted + * before that index. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; + * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var + * @return $this + */ + public function setTextAnchor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\TextAnchor::class); + $this->text_anchor = $var; + + return $this; + } + + /** + * The text that replaces the text identified in the `text_anchor`. + * + * Generated from protobuf field string changed_text = 2; + * @return string + */ + public function getChangedText() + { + return $this->changed_text; + } + + /** + * The text that replaces the text identified in the `text_anchor`. + * + * Generated from protobuf field string changed_text = 2; + * @param string $var + * @return $this + */ + public function setChangedText($var) + { + GPBUtil::checkString($var, True); + $this->changed_text = $var; + + return $this; + } + + /** + * The history of this annotation. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getProvenance() + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + return $this->provenance; + } + + /** + * The history of this annotation. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; + * @param array<\Google\Cloud\DocumentAI\V1\Document\Provenance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setProvenance($var) + { + @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); + $this->provenance = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TextChange::class, \Google\Cloud\DocumentAI\V1\Document_TextChange::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig.php new file mode 100644 index 000000000000..d7f41a08760d --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig.php @@ -0,0 +1,76 @@ +google.cloud.documentai.v1.DocumentOutputConfig + */ +class DocumentOutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig $gcs_output_config + * Output config to write the results to Cloud Storage. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * Output config to write the results to Cloud Storage. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig gcs_output_config = 1; + * @return \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig|null + */ + public function getGcsOutputConfig() + { + return $this->readOneof(1); + } + + public function hasGcsOutputConfig() + { + return $this->hasOneof(1); + } + + /** + * Output config to write the results to Cloud Storage. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig gcs_output_config = 1; + * @param \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig $var + * @return $this + */ + public function setGcsOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig.php new file mode 100644 index 000000000000..cbbd78f0a971 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig.php @@ -0,0 +1,166 @@ +google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + */ +class GcsOutputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The Cloud Storage uri (a directory) of the output. + * + * Generated from protobuf field string gcs_uri = 1; + */ + protected $gcs_uri = ''; + /** + * Specifies which fields to include in the output documents. + * Only supports top level document and pages field so it must be in the + * form of `{document_field_name}` or `pages.{page_field_name}`. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; + */ + protected $field_mask = null; + /** + * Specifies the sharding config for the output document. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig sharding_config = 3; + */ + protected $sharding_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_uri + * The Cloud Storage uri (a directory) of the output. + * @type \Google\Protobuf\FieldMask $field_mask + * Specifies which fields to include in the output documents. + * Only supports top level document and pages field so it must be in the + * form of `{document_field_name}` or `pages.{page_field_name}`. + * @type \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig\ShardingConfig $sharding_config + * Specifies the sharding config for the output document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage uri (a directory) of the output. + * + * Generated from protobuf field string gcs_uri = 1; + * @return string + */ + public function getGcsUri() + { + return $this->gcs_uri; + } + + /** + * The Cloud Storage uri (a directory) of the output. + * + * Generated from protobuf field string gcs_uri = 1; + * @param string $var + * @return $this + */ + public function setGcsUri($var) + { + GPBUtil::checkString($var, True); + $this->gcs_uri = $var; + + return $this; + } + + /** + * Specifies which fields to include in the output documents. + * Only supports top level document and pages field so it must be in the + * form of `{document_field_name}` or `pages.{page_field_name}`. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getFieldMask() + { + return $this->field_mask; + } + + public function hasFieldMask() + { + return isset($this->field_mask); + } + + public function clearFieldMask() + { + unset($this->field_mask); + } + + /** + * Specifies which fields to include in the output documents. + * Only supports top level document and pages field so it must be in the + * form of `{document_field_name}` or `pages.{page_field_name}`. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setFieldMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->field_mask = $var; + + return $this; + } + + /** + * Specifies the sharding config for the output document. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig sharding_config = 3; + * @return \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig\ShardingConfig|null + */ + public function getShardingConfig() + { + return $this->sharding_config; + } + + public function hasShardingConfig() + { + return isset($this->sharding_config); + } + + public function clearShardingConfig() + { + unset($this->sharding_config); + } + + /** + * Specifies the sharding config for the output document. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig sharding_config = 3; + * @param \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig\ShardingConfig $var + * @return $this + */ + public function setShardingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig\ShardingConfig::class); + $this->sharding_config = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GcsOutputConfig::class, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig_GcsOutputConfig::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php new file mode 100644 index 000000000000..9764b5c850c0 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php @@ -0,0 +1,104 @@ +google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + */ +class ShardingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The number of pages per shard. + * + * Generated from protobuf field int32 pages_per_shard = 1; + */ + protected $pages_per_shard = 0; + /** + * The number of overlapping pages between consecutive shards. + * + * Generated from protobuf field int32 pages_overlap = 2; + */ + protected $pages_overlap = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $pages_per_shard + * The number of pages per shard. + * @type int $pages_overlap + * The number of overlapping pages between consecutive shards. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * The number of pages per shard. + * + * Generated from protobuf field int32 pages_per_shard = 1; + * @return int + */ + public function getPagesPerShard() + { + return $this->pages_per_shard; + } + + /** + * The number of pages per shard. + * + * Generated from protobuf field int32 pages_per_shard = 1; + * @param int $var + * @return $this + */ + public function setPagesPerShard($var) + { + GPBUtil::checkInt32($var); + $this->pages_per_shard = $var; + + return $this; + } + + /** + * The number of overlapping pages between consecutive shards. + * + * Generated from protobuf field int32 pages_overlap = 2; + * @return int + */ + public function getPagesOverlap() + { + return $this->pages_overlap; + } + + /** + * The number of overlapping pages between consecutive shards. + * + * Generated from protobuf field int32 pages_overlap = 2; + * @param int $var + * @return $this + */ + public function setPagesOverlap($var) + { + GPBUtil::checkInt32($var); + $this->pages_overlap = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ShardingConfig::class, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig_GcsOutputConfig_ShardingConfig::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema.php new file mode 100644 index 000000000000..13b434f2f8a4 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema.php @@ -0,0 +1,179 @@ +google.cloud.documentai.v1.DocumentSchema + */ +class DocumentSchema extends \Google\Protobuf\Internal\Message +{ + /** + * Display name to show to users. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * Description of the schema. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Entity types of the schema. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + */ + private $entity_types; + /** + * Metadata of the schema. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * Display name to show to users. + * @type string $description + * Description of the schema. + * @type array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType>|\Google\Protobuf\Internal\RepeatedField $entity_types + * Entity types of the schema. + * @type \Google\Cloud\DocumentAI\V1\DocumentSchema\Metadata $metadata + * Metadata of the schema. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); + parent::__construct($data); + } + + /** + * Display name to show to users. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Display name to show to users. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Description of the schema. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the schema. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Entity types of the schema. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntityTypes() + { + return $this->entity_types; + } + + /** + * Entity types of the schema. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; + * @param array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType::class); + $this->entity_types = $arr; + + return $this; + } + + /** + * Metadata of the schema. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + * @return \Google\Cloud\DocumentAI\V1\DocumentSchema\Metadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Metadata of the schema. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; + * @param \Google\Cloud\DocumentAI\V1\DocumentSchema\Metadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema\Metadata::class); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType.php new file mode 100644 index 000000000000..72b224ab8df9 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType.php @@ -0,0 +1,276 @@ +google.cloud.documentai.v1.DocumentSchema.EntityType + */ +class EntityType extends \Google\Protobuf\Internal\Message +{ + /** + * User defined name for the type. + * + * Generated from protobuf field string display_name = 13; + */ + protected $display_name = ''; + /** + * Name of the type. It must be unique within the schema file and + * cannot be a "Common Type". The following naming conventions are used: + * - Use `snake_casing`. + * - Name matching is case-sensitive. + * - Maximum 64 characters. + * - Must start with a letter. + * - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + * compatibility internal infrastructure and tooling can handle any ascii + * character.) + * - The `/` is sometimes used to denote a property of a type. For example + * `line_item/amount`. This convention is deprecated, but will still be + * honored for backward compatibility. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The entity type that this type is derived from. For now, one and only + * one should be set. + * + * Generated from protobuf field repeated string base_types = 2; + */ + private $base_types; + /** + * Description the nested structure, or composition of an entity. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + */ + private $properties; + protected $value_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues $enum_values + * If specified, lists all the possible values for this entity. This + * should not be more than a handful of values. If the number of values + * is >10 or could change frequently use the `EntityType.value_ontology` + * field and specify a list of all possible values in a value ontology + * file. + * @type string $display_name + * User defined name for the type. + * @type string $name + * Name of the type. It must be unique within the schema file and + * cannot be a "Common Type". The following naming conventions are used: + * - Use `snake_casing`. + * - Name matching is case-sensitive. + * - Maximum 64 characters. + * - Must start with a letter. + * - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + * compatibility internal infrastructure and tooling can handle any ascii + * character.) + * - The `/` is sometimes used to denote a property of a type. For example + * `line_item/amount`. This convention is deprecated, but will still be + * honored for backward compatibility. + * @type array|\Google\Protobuf\Internal\RepeatedField $base_types + * The entity type that this type is derived from. For now, one and only + * one should be set. + * @type array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property>|\Google\Protobuf\Internal\RepeatedField $properties + * Description the nested structure, or composition of an entity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); + parent::__construct($data); + } + + /** + * If specified, lists all the possible values for this entity. This + * should not be more than a handful of values. If the number of values + * is >10 or could change frequently use the `EntityType.value_ontology` + * field and specify a list of all possible values in a value ontology + * file. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * @return \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues|null + */ + public function getEnumValues() + { + return $this->readOneof(14); + } + + public function hasEnumValues() + { + return $this->hasOneof(14); + } + + /** + * If specified, lists all the possible values for this entity. This + * should not be more than a handful of values. If the number of values + * is >10 or could change frequently use the `EntityType.value_ontology` + * field and specify a list of all possible values in a value ontology + * file. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; + * @param \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues $var + * @return $this + */ + public function setEnumValues($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * User defined name for the type. + * + * Generated from protobuf field string display_name = 13; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User defined name for the type. + * + * Generated from protobuf field string display_name = 13; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Name of the type. It must be unique within the schema file and + * cannot be a "Common Type". The following naming conventions are used: + * - Use `snake_casing`. + * - Name matching is case-sensitive. + * - Maximum 64 characters. + * - Must start with a letter. + * - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + * compatibility internal infrastructure and tooling can handle any ascii + * character.) + * - The `/` is sometimes used to denote a property of a type. For example + * `line_item/amount`. This convention is deprecated, but will still be + * honored for backward compatibility. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the type. It must be unique within the schema file and + * cannot be a "Common Type". The following naming conventions are used: + * - Use `snake_casing`. + * - Name matching is case-sensitive. + * - Maximum 64 characters. + * - Must start with a letter. + * - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward + * compatibility internal infrastructure and tooling can handle any ascii + * character.) + * - The `/` is sometimes used to denote a property of a type. For example + * `line_item/amount`. This convention is deprecated, but will still be + * honored for backward compatibility. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The entity type that this type is derived from. For now, one and only + * one should be set. + * + * Generated from protobuf field repeated string base_types = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBaseTypes() + { + return $this->base_types; + } + + /** + * The entity type that this type is derived from. For now, one and only + * one should be set. + * + * Generated from protobuf field repeated string base_types = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBaseTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->base_types = $arr; + + return $this; + } + + /** + * Description the nested structure, or composition of an entity. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProperties() + { + return $this->properties; + } + + /** + * Description the nested structure, or composition of an entity. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; + * @param array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProperties($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property::class); + $this->properties = $arr; + + return $this; + } + + /** + * @return string + */ + public function getValueSource() + { + return $this->whichOneof("value_source"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EntityType::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_EntityType::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/EnumValues.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/EnumValues.php new file mode 100644 index 000000000000..40edb0b0d86f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/EnumValues.php @@ -0,0 +1,70 @@ +google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + */ +class EnumValues extends \Google\Protobuf\Internal\Message +{ + /** + * The individual values that this enum values type can include. + * + * Generated from protobuf field repeated string values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * The individual values that this enum values type can include. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); + parent::__construct($data); + } + + /** + * The individual values that this enum values type can include. + * + * Generated from protobuf field repeated string values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * The individual values that this enum values type can include. + * + * Generated from protobuf field repeated string values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EnumValues::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_EntityType_EnumValues::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property.php new file mode 100644 index 000000000000..361a9adebd72 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property.php @@ -0,0 +1,184 @@ +google.cloud.documentai.v1.DocumentSchema.EntityType.Property + */ +class Property extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the property. Follows the same guidelines as the + * EntityType name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * User defined name for the property. + * + * Generated from protobuf field string display_name = 6; + */ + protected $display_name = ''; + /** + * A reference to the value type of the property. This type is subject + * to the same conventions as the `Entity.base_types` field. + * + * Generated from protobuf field string value_type = 2; + */ + protected $value_type = ''; + /** + * Occurrence type limits the number of instances an entity type appears + * in the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + */ + protected $occurrence_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the property. Follows the same guidelines as the + * EntityType name. + * @type string $display_name + * User defined name for the property. + * @type string $value_type + * A reference to the value type of the property. This type is subject + * to the same conventions as the `Entity.base_types` field. + * @type int $occurrence_type + * Occurrence type limits the number of instances an entity type appears + * in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); + parent::__construct($data); + } + + /** + * The name of the property. Follows the same guidelines as the + * EntityType name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the property. Follows the same guidelines as the + * EntityType name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User defined name for the property. + * + * Generated from protobuf field string display_name = 6; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * User defined name for the property. + * + * Generated from protobuf field string display_name = 6; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * A reference to the value type of the property. This type is subject + * to the same conventions as the `Entity.base_types` field. + * + * Generated from protobuf field string value_type = 2; + * @return string + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * A reference to the value type of the property. This type is subject + * to the same conventions as the `Entity.base_types` field. + * + * Generated from protobuf field string value_type = 2; + * @param string $var + * @return $this + */ + public function setValueType($var) + { + GPBUtil::checkString($var, True); + $this->value_type = $var; + + return $this; + } + + /** + * Occurrence type limits the number of instances an entity type appears + * in the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * @return int + */ + public function getOccurrenceType() + { + return $this->occurrence_type; + } + + /** + * Occurrence type limits the number of instances an entity type appears + * in the document. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; + * @param int $var + * @return $this + */ + public function setOccurrenceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property\OccurrenceType::class); + $this->occurrence_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Property::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_EntityType_Property::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property/OccurrenceType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property/OccurrenceType.php new file mode 100644 index 000000000000..18ae968b954a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property/OccurrenceType.php @@ -0,0 +1,88 @@ +google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + */ +class OccurrenceType +{ + /** + * Unspecified occurrence type. + * + * Generated from protobuf enum OCCURRENCE_TYPE_UNSPECIFIED = 0; + */ + const OCCURRENCE_TYPE_UNSPECIFIED = 0; + /** + * There will be zero or one instance of this entity type. The same + * entity instance may be mentioned multiple times. + * + * Generated from protobuf enum OPTIONAL_ONCE = 1; + */ + const OPTIONAL_ONCE = 1; + /** + * The entity type will appear zero or multiple times. + * + * Generated from protobuf enum OPTIONAL_MULTIPLE = 2; + */ + const OPTIONAL_MULTIPLE = 2; + /** + * The entity type will only appear exactly once. The same + * entity instance may be mentioned multiple times. + * + * Generated from protobuf enum REQUIRED_ONCE = 3; + */ + const REQUIRED_ONCE = 3; + /** + * The entity type will appear once or more times. + * + * Generated from protobuf enum REQUIRED_MULTIPLE = 4; + */ + const REQUIRED_MULTIPLE = 4; + + private static $valueToName = [ + self::OCCURRENCE_TYPE_UNSPECIFIED => 'OCCURRENCE_TYPE_UNSPECIFIED', + self::OPTIONAL_ONCE => 'OPTIONAL_ONCE', + self::OPTIONAL_MULTIPLE => 'OPTIONAL_MULTIPLE', + self::REQUIRED_ONCE => 'REQUIRED_ONCE', + self::REQUIRED_MULTIPLE => 'REQUIRED_MULTIPLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OccurrenceType::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_EntityType_Property_OccurrenceType::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/Metadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/Metadata.php new file mode 100644 index 000000000000..a7906306349a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/Metadata.php @@ -0,0 +1,192 @@ +google.cloud.documentai.v1.DocumentSchema.Metadata + */ +class Metadata extends \Google\Protobuf\Internal\Message +{ + /** + * If true, a `document` entity type can be applied to subdocument + * (splitting). Otherwise, it can only be applied to the entire document + * (classification). + * + * Generated from protobuf field bool document_splitter = 1; + */ + protected $document_splitter = false; + /** + * If true, on a given page, there can be multiple `document` annotations + * covering it. + * + * Generated from protobuf field bool document_allow_multiple_labels = 2; + */ + protected $document_allow_multiple_labels = false; + /** + * If set, all the nested entities must be prefixed with the parents. + * + * Generated from protobuf field bool prefixed_naming_on_properties = 6; + */ + protected $prefixed_naming_on_properties = false; + /** + * If set, we will skip the naming format validation in the schema. So the + * string values in `DocumentSchema.EntityType.name` and + * `DocumentSchema.EntityType.Property.name` will not be checked. + * + * Generated from protobuf field bool skip_naming_validation = 7; + */ + protected $skip_naming_validation = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $document_splitter + * If true, a `document` entity type can be applied to subdocument + * (splitting). Otherwise, it can only be applied to the entire document + * (classification). + * @type bool $document_allow_multiple_labels + * If true, on a given page, there can be multiple `document` annotations + * covering it. + * @type bool $prefixed_naming_on_properties + * If set, all the nested entities must be prefixed with the parents. + * @type bool $skip_naming_validation + * If set, we will skip the naming format validation in the schema. So the + * string values in `DocumentSchema.EntityType.name` and + * `DocumentSchema.EntityType.Property.name` will not be checked. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); + parent::__construct($data); + } + + /** + * If true, a `document` entity type can be applied to subdocument + * (splitting). Otherwise, it can only be applied to the entire document + * (classification). + * + * Generated from protobuf field bool document_splitter = 1; + * @return bool + */ + public function getDocumentSplitter() + { + return $this->document_splitter; + } + + /** + * If true, a `document` entity type can be applied to subdocument + * (splitting). Otherwise, it can only be applied to the entire document + * (classification). + * + * Generated from protobuf field bool document_splitter = 1; + * @param bool $var + * @return $this + */ + public function setDocumentSplitter($var) + { + GPBUtil::checkBool($var); + $this->document_splitter = $var; + + return $this; + } + + /** + * If true, on a given page, there can be multiple `document` annotations + * covering it. + * + * Generated from protobuf field bool document_allow_multiple_labels = 2; + * @return bool + */ + public function getDocumentAllowMultipleLabels() + { + return $this->document_allow_multiple_labels; + } + + /** + * If true, on a given page, there can be multiple `document` annotations + * covering it. + * + * Generated from protobuf field bool document_allow_multiple_labels = 2; + * @param bool $var + * @return $this + */ + public function setDocumentAllowMultipleLabels($var) + { + GPBUtil::checkBool($var); + $this->document_allow_multiple_labels = $var; + + return $this; + } + + /** + * If set, all the nested entities must be prefixed with the parents. + * + * Generated from protobuf field bool prefixed_naming_on_properties = 6; + * @return bool + */ + public function getPrefixedNamingOnProperties() + { + return $this->prefixed_naming_on_properties; + } + + /** + * If set, all the nested entities must be prefixed with the parents. + * + * Generated from protobuf field bool prefixed_naming_on_properties = 6; + * @param bool $var + * @return $this + */ + public function setPrefixedNamingOnProperties($var) + { + GPBUtil::checkBool($var); + $this->prefixed_naming_on_properties = $var; + + return $this; + } + + /** + * If set, we will skip the naming format validation in the schema. So the + * string values in `DocumentSchema.EntityType.name` and + * `DocumentSchema.EntityType.Property.name` will not be checked. + * + * Generated from protobuf field bool skip_naming_validation = 7; + * @return bool + */ + public function getSkipNamingValidation() + { + return $this->skip_naming_validation; + } + + /** + * If set, we will skip the naming format validation in the schema. So the + * string values in `DocumentSchema.EntityType.name` and + * `DocumentSchema.EntityType.Property.name` will not be checked. + * + * Generated from protobuf field bool skip_naming_validation = 7; + * @param bool $var + * @return $this + */ + public function setSkipNamingValidation($var) + { + GPBUtil::checkBool($var); + $this->skip_naming_validation = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Metadata::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_Metadata::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorMetadata.php new file mode 100644 index 000000000000..dc3948aaae17 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorMetadata.php @@ -0,0 +1,79 @@ +google.cloud.documentai.v1.EnableProcessorMetadata + */ +class EnableProcessorMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + protected $common_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorRequest.php new file mode 100644 index 000000000000..3e3a5c3e66b6 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorRequest.php @@ -0,0 +1,69 @@ +google.cloud.documentai.v1.EnableProcessorRequest + */ +class EnableProcessorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor resource name to be enabled. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor resource name to be enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor resource name to be enabled. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor resource name to be enabled. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorResponse.php new file mode 100644 index 000000000000..573c89ac5fa2 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorResponse.php @@ -0,0 +1,35 @@ +google.cloud.documentai.v1.EnableProcessorResponse + */ +class EnableProcessorResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionMetadata.php new file mode 100644 index 000000000000..4ac915145e9d --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionMetadata.php @@ -0,0 +1,79 @@ +google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + */ +class EvaluateProcessorVersionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + protected $common_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionRequest.php new file mode 100644 index 000000000000..3cada6bf65f7 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionRequest.php @@ -0,0 +1,146 @@ +google.cloud.documentai.v1.EvaluateProcessorVersionRequest + */ +class EvaluateProcessorVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $processor_version = ''; + /** + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $evaluation_documents = null; + + /** + * @param string $processorVersion Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\EvaluateProcessorVersionRequest + * + * @experimental + */ + public static function build(string $processorVersion): self + { + return (new self()) + ->setProcessorVersion($processorVersion); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $processor_version + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $evaluation_documents + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProcessorVersion() + { + return $this->processor_version; + } + + /** + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProcessorVersion($var) + { + GPBUtil::checkString($var, True); + $this->processor_version = $var; + + return $this; + } + + /** + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null + */ + public function getEvaluationDocuments() + { + return $this->evaluation_documents; + } + + public function hasEvaluationDocuments() + { + return isset($this->evaluation_documents); + } + + public function clearEvaluationDocuments() + { + unset($this->evaluation_documents); + } + + /** + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var + * @return $this + */ + public function setEvaluationDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig::class); + $this->evaluation_documents = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionResponse.php new file mode 100644 index 000000000000..df4d38b40cde --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionResponse.php @@ -0,0 +1,69 @@ +google.cloud.documentai.v1.EvaluateProcessorVersionResponse + */ +class EvaluateProcessorVersionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the created evaluation. + * + * Generated from protobuf field string evaluation = 2; + */ + protected $evaluation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $evaluation + * The resource name of the created evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the created evaluation. + * + * Generated from protobuf field string evaluation = 2; + * @return string + */ + public function getEvaluation() + { + return $this->evaluation; + } + + /** + * The resource name of the created evaluation. + * + * Generated from protobuf field string evaluation = 2; + * @param string $var + * @return $this + */ + public function setEvaluation($var) + { + GPBUtil::checkString($var, True); + $this->evaluation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation.php new file mode 100644 index 000000000000..7c1964f147c9 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation.php @@ -0,0 +1,309 @@ +google.cloud.documentai.v1.Evaluation + */ +class Evaluation extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the evaluation. + * Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The time that the evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + */ + protected $create_time = null; + /** + * Counters for the documents used in the evaluation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + */ + protected $document_counters = null; + /** + * Metrics for all the entities in aggregate. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + */ + protected $all_entities_metrics = null; + /** + * Metrics across confidence levels, for different entities. + * + * Generated from protobuf field map entity_metrics = 4; + */ + private $entity_metrics; + /** + * The KMS key name used for encryption. + * + * Generated from protobuf field string kms_key_name = 6; + */ + protected $kms_key_name = ''; + /** + * The KMS key version with which data is encrypted. + * + * Generated from protobuf field string kms_key_version_name = 7; + */ + protected $kms_key_version_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the evaluation. + * Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + * @type \Google\Protobuf\Timestamp $create_time + * The time that the evaluation was created. + * @type \Google\Cloud\DocumentAI\V1\Evaluation\Counters $document_counters + * Counters for the documents used in the evaluation. + * @type \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics $all_entities_metrics + * Metrics for all the entities in aggregate. + * @type array|\Google\Protobuf\Internal\MapField $entity_metrics + * Metrics across confidence levels, for different entities. + * @type string $kms_key_name + * The KMS key name used for encryption. + * @type string $kms_key_version_name + * The KMS key version with which data is encrypted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the evaluation. + * Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the evaluation. + * Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The time that the evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time that the evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Counters for the documents used in the evaluation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + * @return \Google\Cloud\DocumentAI\V1\Evaluation\Counters|null + */ + public function getDocumentCounters() + { + return $this->document_counters; + } + + public function hasDocumentCounters() + { + return isset($this->document_counters); + } + + public function clearDocumentCounters() + { + unset($this->document_counters); + } + + /** + * Counters for the documents used in the evaluation. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; + * @param \Google\Cloud\DocumentAI\V1\Evaluation\Counters $var + * @return $this + */ + public function setDocumentCounters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Counters::class); + $this->document_counters = $var; + + return $this; + } + + /** + * Metrics for all the entities in aggregate. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * @return \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics|null + */ + public function getAllEntitiesMetrics() + { + return $this->all_entities_metrics; + } + + public function hasAllEntitiesMetrics() + { + return isset($this->all_entities_metrics); + } + + public function clearAllEntitiesMetrics() + { + unset($this->all_entities_metrics); + } + + /** + * Metrics for all the entities in aggregate. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; + * @param \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics $var + * @return $this + */ + public function setAllEntitiesMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics::class); + $this->all_entities_metrics = $var; + + return $this; + } + + /** + * Metrics across confidence levels, for different entities. + * + * Generated from protobuf field map entity_metrics = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getEntityMetrics() + { + return $this->entity_metrics; + } + + /** + * Metrics across confidence levels, for different entities. + * + * Generated from protobuf field map entity_metrics = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setEntityMetrics($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics::class); + $this->entity_metrics = $arr; + + return $this; + } + + /** + * The KMS key name used for encryption. + * + * Generated from protobuf field string kms_key_name = 6; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * The KMS key name used for encryption. + * + * Generated from protobuf field string kms_key_name = 6; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + + /** + * The KMS key version with which data is encrypted. + * + * Generated from protobuf field string kms_key_version_name = 7; + * @return string + */ + public function getKmsKeyVersionName() + { + return $this->kms_key_version_name; + } + + /** + * The KMS key version with which data is encrypted. + * + * Generated from protobuf field string kms_key_version_name = 7; + * @param string $var + * @return $this + */ + public function setKmsKeyVersionName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_version_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/ConfidenceLevelMetrics.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/ConfidenceLevelMetrics.php new file mode 100644 index 000000000000..41905bc2b7ff --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/ConfidenceLevelMetrics.php @@ -0,0 +1,114 @@ +google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + */ +class ConfidenceLevelMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * The confidence level. + * + * Generated from protobuf field float confidence_level = 1; + */ + protected $confidence_level = 0.0; + /** + * The metrics at the specific confidence level. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + */ + protected $metrics = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $confidence_level + * The confidence level. + * @type \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $metrics + * The metrics at the specific confidence level. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); + parent::__construct($data); + } + + /** + * The confidence level. + * + * Generated from protobuf field float confidence_level = 1; + * @return float + */ + public function getConfidenceLevel() + { + return $this->confidence_level; + } + + /** + * The confidence level. + * + * Generated from protobuf field float confidence_level = 1; + * @param float $var + * @return $this + */ + public function setConfidenceLevel($var) + { + GPBUtil::checkFloat($var); + $this->confidence_level = $var; + + return $this; + } + + /** + * The metrics at the specific confidence level. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + * @return \Google\Cloud\DocumentAI\V1\Evaluation\Metrics|null + */ + public function getMetrics() + { + return $this->metrics; + } + + public function hasMetrics() + { + return isset($this->metrics); + } + + public function clearMetrics() + { + unset($this->metrics); + } + + /** + * The metrics at the specific confidence level. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; + * @param \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $var + * @return $this + */ + public function setMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Metrics::class); + $this->metrics = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfidenceLevelMetrics::class, \Google\Cloud\DocumentAI\V1\Evaluation_ConfidenceLevelMetrics::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Counters.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Counters.php new file mode 100644 index 000000000000..525a04970600 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Counters.php @@ -0,0 +1,180 @@ +google.cloud.documentai.v1.Evaluation.Counters + */ +class Counters extends \Google\Protobuf\Internal\Message +{ + /** + * How many documents were sent for evaluation. + * + * Generated from protobuf field int32 input_documents_count = 1; + */ + protected $input_documents_count = 0; + /** + * How many documents were not included in the evaluation as they didn't + * pass validation. + * + * Generated from protobuf field int32 invalid_documents_count = 2; + */ + protected $invalid_documents_count = 0; + /** + * How many documents were not included in the evaluation as Document AI + * failed to process them. + * + * Generated from protobuf field int32 failed_documents_count = 3; + */ + protected $failed_documents_count = 0; + /** + * How many documents were used in the evaluation. + * + * Generated from protobuf field int32 evaluated_documents_count = 4; + */ + protected $evaluated_documents_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $input_documents_count + * How many documents were sent for evaluation. + * @type int $invalid_documents_count + * How many documents were not included in the evaluation as they didn't + * pass validation. + * @type int $failed_documents_count + * How many documents were not included in the evaluation as Document AI + * failed to process them. + * @type int $evaluated_documents_count + * How many documents were used in the evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); + parent::__construct($data); + } + + /** + * How many documents were sent for evaluation. + * + * Generated from protobuf field int32 input_documents_count = 1; + * @return int + */ + public function getInputDocumentsCount() + { + return $this->input_documents_count; + } + + /** + * How many documents were sent for evaluation. + * + * Generated from protobuf field int32 input_documents_count = 1; + * @param int $var + * @return $this + */ + public function setInputDocumentsCount($var) + { + GPBUtil::checkInt32($var); + $this->input_documents_count = $var; + + return $this; + } + + /** + * How many documents were not included in the evaluation as they didn't + * pass validation. + * + * Generated from protobuf field int32 invalid_documents_count = 2; + * @return int + */ + public function getInvalidDocumentsCount() + { + return $this->invalid_documents_count; + } + + /** + * How many documents were not included in the evaluation as they didn't + * pass validation. + * + * Generated from protobuf field int32 invalid_documents_count = 2; + * @param int $var + * @return $this + */ + public function setInvalidDocumentsCount($var) + { + GPBUtil::checkInt32($var); + $this->invalid_documents_count = $var; + + return $this; + } + + /** + * How many documents were not included in the evaluation as Document AI + * failed to process them. + * + * Generated from protobuf field int32 failed_documents_count = 3; + * @return int + */ + public function getFailedDocumentsCount() + { + return $this->failed_documents_count; + } + + /** + * How many documents were not included in the evaluation as Document AI + * failed to process them. + * + * Generated from protobuf field int32 failed_documents_count = 3; + * @param int $var + * @return $this + */ + public function setFailedDocumentsCount($var) + { + GPBUtil::checkInt32($var); + $this->failed_documents_count = $var; + + return $this; + } + + /** + * How many documents were used in the evaluation. + * + * Generated from protobuf field int32 evaluated_documents_count = 4; + * @return int + */ + public function getEvaluatedDocumentsCount() + { + return $this->evaluated_documents_count; + } + + /** + * How many documents were used in the evaluation. + * + * Generated from protobuf field int32 evaluated_documents_count = 4; + * @param int $var + * @return $this + */ + public function setEvaluatedDocumentsCount($var) + { + GPBUtil::checkInt32($var); + $this->evaluated_documents_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Counters::class, \Google\Cloud\DocumentAI\V1\Evaluation_Counters::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Metrics.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Metrics.php new file mode 100644 index 000000000000..daf92a7fb96a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Metrics.php @@ -0,0 +1,410 @@ +google.cloud.documentai.v1.Evaluation.Metrics + */ +class Metrics extends \Google\Protobuf\Internal\Message +{ + /** + * The calculated precision. + * + * Generated from protobuf field float precision = 1; + */ + protected $precision = 0.0; + /** + * The calculated recall. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + /** + * The calculated f1 score. + * + * Generated from protobuf field float f1_score = 3; + */ + protected $f1_score = 0.0; + /** + * The amount of occurrences in predicted documents. + * + * Generated from protobuf field int32 predicted_occurrences_count = 4; + */ + protected $predicted_occurrences_count = 0; + /** + * The amount of occurrences in ground truth documents. + * + * Generated from protobuf field int32 ground_truth_occurrences_count = 5; + */ + protected $ground_truth_occurrences_count = 0; + /** + * The amount of documents with a predicted occurrence. + * + * Generated from protobuf field int32 predicted_document_count = 10; + */ + protected $predicted_document_count = 0; + /** + * The amount of documents with a ground truth occurrence. + * + * Generated from protobuf field int32 ground_truth_document_count = 11; + */ + protected $ground_truth_document_count = 0; + /** + * The amount of true positives. + * + * Generated from protobuf field int32 true_positives_count = 6; + */ + protected $true_positives_count = 0; + /** + * The amount of false positives. + * + * Generated from protobuf field int32 false_positives_count = 7; + */ + protected $false_positives_count = 0; + /** + * The amount of false negatives. + * + * Generated from protobuf field int32 false_negatives_count = 8; + */ + protected $false_negatives_count = 0; + /** + * The amount of documents that had an occurrence of this label. + * + * Generated from protobuf field int32 total_documents_count = 9; + */ + protected $total_documents_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $precision + * The calculated precision. + * @type float $recall + * The calculated recall. + * @type float $f1_score + * The calculated f1 score. + * @type int $predicted_occurrences_count + * The amount of occurrences in predicted documents. + * @type int $ground_truth_occurrences_count + * The amount of occurrences in ground truth documents. + * @type int $predicted_document_count + * The amount of documents with a predicted occurrence. + * @type int $ground_truth_document_count + * The amount of documents with a ground truth occurrence. + * @type int $true_positives_count + * The amount of true positives. + * @type int $false_positives_count + * The amount of false positives. + * @type int $false_negatives_count + * The amount of false negatives. + * @type int $total_documents_count + * The amount of documents that had an occurrence of this label. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); + parent::__construct($data); + } + + /** + * The calculated precision. + * + * Generated from protobuf field float precision = 1; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * The calculated precision. + * + * Generated from protobuf field float precision = 1; + * @param float $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkFloat($var); + $this->precision = $var; + + return $this; + } + + /** + * The calculated recall. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * The calculated recall. + * + * Generated from protobuf field float recall = 2; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + + /** + * The calculated f1 score. + * + * Generated from protobuf field float f1_score = 3; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * The calculated f1 score. + * + * Generated from protobuf field float f1_score = 3; + * @param float $var + * @return $this + */ + public function setF1Score($var) + { + GPBUtil::checkFloat($var); + $this->f1_score = $var; + + return $this; + } + + /** + * The amount of occurrences in predicted documents. + * + * Generated from protobuf field int32 predicted_occurrences_count = 4; + * @return int + */ + public function getPredictedOccurrencesCount() + { + return $this->predicted_occurrences_count; + } + + /** + * The amount of occurrences in predicted documents. + * + * Generated from protobuf field int32 predicted_occurrences_count = 4; + * @param int $var + * @return $this + */ + public function setPredictedOccurrencesCount($var) + { + GPBUtil::checkInt32($var); + $this->predicted_occurrences_count = $var; + + return $this; + } + + /** + * The amount of occurrences in ground truth documents. + * + * Generated from protobuf field int32 ground_truth_occurrences_count = 5; + * @return int + */ + public function getGroundTruthOccurrencesCount() + { + return $this->ground_truth_occurrences_count; + } + + /** + * The amount of occurrences in ground truth documents. + * + * Generated from protobuf field int32 ground_truth_occurrences_count = 5; + * @param int $var + * @return $this + */ + public function setGroundTruthOccurrencesCount($var) + { + GPBUtil::checkInt32($var); + $this->ground_truth_occurrences_count = $var; + + return $this; + } + + /** + * The amount of documents with a predicted occurrence. + * + * Generated from protobuf field int32 predicted_document_count = 10; + * @return int + */ + public function getPredictedDocumentCount() + { + return $this->predicted_document_count; + } + + /** + * The amount of documents with a predicted occurrence. + * + * Generated from protobuf field int32 predicted_document_count = 10; + * @param int $var + * @return $this + */ + public function setPredictedDocumentCount($var) + { + GPBUtil::checkInt32($var); + $this->predicted_document_count = $var; + + return $this; + } + + /** + * The amount of documents with a ground truth occurrence. + * + * Generated from protobuf field int32 ground_truth_document_count = 11; + * @return int + */ + public function getGroundTruthDocumentCount() + { + return $this->ground_truth_document_count; + } + + /** + * The amount of documents with a ground truth occurrence. + * + * Generated from protobuf field int32 ground_truth_document_count = 11; + * @param int $var + * @return $this + */ + public function setGroundTruthDocumentCount($var) + { + GPBUtil::checkInt32($var); + $this->ground_truth_document_count = $var; + + return $this; + } + + /** + * The amount of true positives. + * + * Generated from protobuf field int32 true_positives_count = 6; + * @return int + */ + public function getTruePositivesCount() + { + return $this->true_positives_count; + } + + /** + * The amount of true positives. + * + * Generated from protobuf field int32 true_positives_count = 6; + * @param int $var + * @return $this + */ + public function setTruePositivesCount($var) + { + GPBUtil::checkInt32($var); + $this->true_positives_count = $var; + + return $this; + } + + /** + * The amount of false positives. + * + * Generated from protobuf field int32 false_positives_count = 7; + * @return int + */ + public function getFalsePositivesCount() + { + return $this->false_positives_count; + } + + /** + * The amount of false positives. + * + * Generated from protobuf field int32 false_positives_count = 7; + * @param int $var + * @return $this + */ + public function setFalsePositivesCount($var) + { + GPBUtil::checkInt32($var); + $this->false_positives_count = $var; + + return $this; + } + + /** + * The amount of false negatives. + * + * Generated from protobuf field int32 false_negatives_count = 8; + * @return int + */ + public function getFalseNegativesCount() + { + return $this->false_negatives_count; + } + + /** + * The amount of false negatives. + * + * Generated from protobuf field int32 false_negatives_count = 8; + * @param int $var + * @return $this + */ + public function setFalseNegativesCount($var) + { + GPBUtil::checkInt32($var); + $this->false_negatives_count = $var; + + return $this; + } + + /** + * The amount of documents that had an occurrence of this label. + * + * Generated from protobuf field int32 total_documents_count = 9; + * @return int + */ + public function getTotalDocumentsCount() + { + return $this->total_documents_count; + } + + /** + * The amount of documents that had an occurrence of this label. + * + * Generated from protobuf field int32 total_documents_count = 9; + * @param int $var + * @return $this + */ + public function setTotalDocumentsCount($var) + { + GPBUtil::checkInt32($var); + $this->total_documents_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Metrics::class, \Google\Cloud\DocumentAI\V1\Evaluation_Metrics::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics.php new file mode 100644 index 000000000000..5fddfea94ab2 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics.php @@ -0,0 +1,290 @@ +google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + */ +class MultiConfidenceMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Metrics across confidence levels with fuzzy matching enabled. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + */ + private $confidence_level_metrics; + /** + * Metrics across confidence levels with only exact matching. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + */ + private $confidence_level_metrics_exact; + /** + * The calculated area under the precision recall curve (AUPRC), computed by + * integrating over all confidence thresholds. + * + * Generated from protobuf field float auprc = 2; + */ + protected $auprc = 0.0; + /** + * The Estimated Calibration Error (ECE) of the confidence of the predicted + * entities. + * + * Generated from protobuf field float estimated_calibration_error = 3; + */ + protected $estimated_calibration_error = 0.0; + /** + * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + * only. + * + * Generated from protobuf field float auprc_exact = 5; + */ + protected $auprc_exact = 0.0; + /** + * The ECE for the predicted entities with fuzzy matching disabled, i.e., + * exact matching only. + * + * Generated from protobuf field float estimated_calibration_error_exact = 6; + */ + protected $estimated_calibration_error_exact = 0.0; + /** + * The metrics type for the label. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + */ + protected $metrics_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics>|\Google\Protobuf\Internal\RepeatedField $confidence_level_metrics + * Metrics across confidence levels with fuzzy matching enabled. + * @type array<\Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics>|\Google\Protobuf\Internal\RepeatedField $confidence_level_metrics_exact + * Metrics across confidence levels with only exact matching. + * @type float $auprc + * The calculated area under the precision recall curve (AUPRC), computed by + * integrating over all confidence thresholds. + * @type float $estimated_calibration_error + * The Estimated Calibration Error (ECE) of the confidence of the predicted + * entities. + * @type float $auprc_exact + * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + * only. + * @type float $estimated_calibration_error_exact + * The ECE for the predicted entities with fuzzy matching disabled, i.e., + * exact matching only. + * @type int $metrics_type + * The metrics type for the label. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); + parent::__construct($data); + } + + /** + * Metrics across confidence levels with fuzzy matching enabled. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConfidenceLevelMetrics() + { + return $this->confidence_level_metrics; + } + + /** + * Metrics across confidence levels with fuzzy matching enabled. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConfidenceLevelMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics::class); + $this->confidence_level_metrics = $arr; + + return $this; + } + + /** + * Metrics across confidence levels with only exact matching. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConfidenceLevelMetricsExact() + { + return $this->confidence_level_metrics_exact; + } + + /** + * Metrics across confidence levels with only exact matching. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; + * @param array<\Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConfidenceLevelMetricsExact($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics::class); + $this->confidence_level_metrics_exact = $arr; + + return $this; + } + + /** + * The calculated area under the precision recall curve (AUPRC), computed by + * integrating over all confidence thresholds. + * + * Generated from protobuf field float auprc = 2; + * @return float + */ + public function getAuprc() + { + return $this->auprc; + } + + /** + * The calculated area under the precision recall curve (AUPRC), computed by + * integrating over all confidence thresholds. + * + * Generated from protobuf field float auprc = 2; + * @param float $var + * @return $this + */ + public function setAuprc($var) + { + GPBUtil::checkFloat($var); + $this->auprc = $var; + + return $this; + } + + /** + * The Estimated Calibration Error (ECE) of the confidence of the predicted + * entities. + * + * Generated from protobuf field float estimated_calibration_error = 3; + * @return float + */ + public function getEstimatedCalibrationError() + { + return $this->estimated_calibration_error; + } + + /** + * The Estimated Calibration Error (ECE) of the confidence of the predicted + * entities. + * + * Generated from protobuf field float estimated_calibration_error = 3; + * @param float $var + * @return $this + */ + public function setEstimatedCalibrationError($var) + { + GPBUtil::checkFloat($var); + $this->estimated_calibration_error = $var; + + return $this; + } + + /** + * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + * only. + * + * Generated from protobuf field float auprc_exact = 5; + * @return float + */ + public function getAuprcExact() + { + return $this->auprc_exact; + } + + /** + * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + * only. + * + * Generated from protobuf field float auprc_exact = 5; + * @param float $var + * @return $this + */ + public function setAuprcExact($var) + { + GPBUtil::checkFloat($var); + $this->auprc_exact = $var; + + return $this; + } + + /** + * The ECE for the predicted entities with fuzzy matching disabled, i.e., + * exact matching only. + * + * Generated from protobuf field float estimated_calibration_error_exact = 6; + * @return float + */ + public function getEstimatedCalibrationErrorExact() + { + return $this->estimated_calibration_error_exact; + } + + /** + * The ECE for the predicted entities with fuzzy matching disabled, i.e., + * exact matching only. + * + * Generated from protobuf field float estimated_calibration_error_exact = 6; + * @param float $var + * @return $this + */ + public function setEstimatedCalibrationErrorExact($var) + { + GPBUtil::checkFloat($var); + $this->estimated_calibration_error_exact = $var; + + return $this; + } + + /** + * The metrics type for the label. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * @return int + */ + public function getMetricsType() + { + return $this->metrics_type; + } + + /** + * The metrics type for the label. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; + * @param int $var + * @return $this + */ + public function setMetricsType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics\MetricsType::class); + $this->metrics_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MultiConfidenceMetrics::class, \Google\Cloud\DocumentAI\V1\Evaluation_MultiConfidenceMetrics::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php new file mode 100644 index 000000000000..d48051e88622 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php @@ -0,0 +1,63 @@ +google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType + */ +class MetricsType +{ + /** + * The metrics type is unspecified. By default, metrics without a + * particular specification are for leaf entity types (i.e., top-level + * entity types without child types, or child types which are not + * parent types themselves). + * + * Generated from protobuf enum METRICS_TYPE_UNSPECIFIED = 0; + */ + const METRICS_TYPE_UNSPECIFIED = 0; + /** + * Indicates whether metrics for this particular label type represent an + * aggregate of metrics for other types instead of being based on actual + * TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) + * entity types are an aggregate of metrics for their children. + * + * Generated from protobuf enum AGGREGATE = 1; + */ + const AGGREGATE = 1; + + private static $valueToName = [ + self::METRICS_TYPE_UNSPECIFIED => 'METRICS_TYPE_UNSPECIFIED', + self::AGGREGATE => 'AGGREGATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MetricsType::class, \Google\Cloud\DocumentAI\V1\Evaluation_MultiConfidenceMetrics_MetricsType::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluationReference.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluationReference.php new file mode 100644 index 000000000000..4e86a056e7f1 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluationReference.php @@ -0,0 +1,189 @@ +google.cloud.documentai.v1.EvaluationReference + */ +class EvaluationReference extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the Long Running Operation for the evaluation. + * + * Generated from protobuf field string operation = 1; + */ + protected $operation = ''; + /** + * The resource name of the evaluation. + * + * Generated from protobuf field string evaluation = 2 [(.google.api.resource_reference) = { + */ + protected $evaluation = ''; + /** + * An aggregate of the statistics for the evaluation with fuzzy matching on. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + */ + protected $aggregate_metrics = null; + /** + * An aggregate of the statistics for the evaluation with fuzzy matching off. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + */ + protected $aggregate_metrics_exact = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * The resource name of the Long Running Operation for the evaluation. + * @type string $evaluation + * The resource name of the evaluation. + * @type \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $aggregate_metrics + * An aggregate of the statistics for the evaluation with fuzzy matching on. + * @type \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $aggregate_metrics_exact + * An aggregate of the statistics for the evaluation with fuzzy matching off. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the Long Running Operation for the evaluation. + * + * Generated from protobuf field string operation = 1; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * The resource name of the Long Running Operation for the evaluation. + * + * Generated from protobuf field string operation = 1; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $var; + + return $this; + } + + /** + * The resource name of the evaluation. + * + * Generated from protobuf field string evaluation = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getEvaluation() + { + return $this->evaluation; + } + + /** + * The resource name of the evaluation. + * + * Generated from protobuf field string evaluation = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEvaluation($var) + { + GPBUtil::checkString($var, True); + $this->evaluation = $var; + + return $this; + } + + /** + * An aggregate of the statistics for the evaluation with fuzzy matching on. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + * @return \Google\Cloud\DocumentAI\V1\Evaluation\Metrics|null + */ + public function getAggregateMetrics() + { + return $this->aggregate_metrics; + } + + public function hasAggregateMetrics() + { + return isset($this->aggregate_metrics); + } + + public function clearAggregateMetrics() + { + unset($this->aggregate_metrics); + } + + /** + * An aggregate of the statistics for the evaluation with fuzzy matching on. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; + * @param \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $var + * @return $this + */ + public function setAggregateMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Metrics::class); + $this->aggregate_metrics = $var; + + return $this; + } + + /** + * An aggregate of the statistics for the evaluation with fuzzy matching off. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + * @return \Google\Cloud\DocumentAI\V1\Evaluation\Metrics|null + */ + public function getAggregateMetricsExact() + { + return $this->aggregate_metrics_exact; + } + + public function hasAggregateMetricsExact() + { + return isset($this->aggregate_metrics_exact); + } + + public function clearAggregateMetricsExact() + { + unset($this->aggregate_metrics_exact); + } + + /** + * An aggregate of the statistics for the evaluation with fuzzy matching off. + * + * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; + * @param \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $var + * @return $this + */ + public function setAggregateMetricsExact($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Metrics::class); + $this->aggregate_metrics_exact = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesRequest.php new file mode 100644 index 000000000000..f16e7109954b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesRequest.php @@ -0,0 +1,89 @@ +google.cloud.documentai.v1.FetchProcessorTypesRequest + */ +class FetchProcessorTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. Please see + * {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\FetchProcessorTypesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesResponse.php new file mode 100644 index 000000000000..dd5747eca369 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesResponse.php @@ -0,0 +1,69 @@ +google.cloud.documentai.v1.FetchProcessorTypesResponse + */ +class FetchProcessorTypesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of processor types. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + private $processor_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $processor_types + * The list of processor types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The list of processor types. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProcessorTypes() + { + return $this->processor_types; + } + + /** + * The list of processor types. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + * @param array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProcessorTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorType::class); + $this->processor_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocument.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocument.php new file mode 100644 index 000000000000..29eb74b4cdad --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocument.php @@ -0,0 +1,101 @@ +google.cloud.documentai.v1.GcsDocument + */ +class GcsDocument extends \Google\Protobuf\Internal\Message +{ + /** + * The Cloud Storage object uri. + * + * Generated from protobuf field string gcs_uri = 1; + */ + protected $gcs_uri = ''; + /** + * An IANA MIME type (RFC6838) of the content. + * + * Generated from protobuf field string mime_type = 2; + */ + protected $mime_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_uri + * The Cloud Storage object uri. + * @type string $mime_type + * An IANA MIME type (RFC6838) of the content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage object uri. + * + * Generated from protobuf field string gcs_uri = 1; + * @return string + */ + public function getGcsUri() + { + return $this->gcs_uri; + } + + /** + * The Cloud Storage object uri. + * + * Generated from protobuf field string gcs_uri = 1; + * @param string $var + * @return $this + */ + public function setGcsUri($var) + { + GPBUtil::checkString($var, True); + $this->gcs_uri = $var; + + return $this; + } + + /** + * An IANA MIME type (RFC6838) of the content. + * + * Generated from protobuf field string mime_type = 2; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * An IANA MIME type (RFC6838) of the content. + * + * Generated from protobuf field string mime_type = 2; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocuments.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocuments.php new file mode 100644 index 000000000000..c23bdc383d2f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocuments.php @@ -0,0 +1,67 @@ +google.cloud.documentai.v1.GcsDocuments + */ +class GcsDocuments extends \Google\Protobuf\Internal\Message +{ + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; + */ + private $documents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\GcsDocument>|\Google\Protobuf\Internal\RepeatedField $documents + * The list of documents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * The list of documents. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; + * @param array<\Google\Cloud\DocumentAI\V1\GcsDocument>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\GcsDocument::class); + $this->documents = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsPrefix.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsPrefix.php new file mode 100644 index 000000000000..47f0c4f619e3 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsPrefix.php @@ -0,0 +1,67 @@ +google.cloud.documentai.v1.GcsPrefix + */ +class GcsPrefix extends \Google\Protobuf\Internal\Message +{ + /** + * The URI prefix. + * + * Generated from protobuf field string gcs_uri_prefix = 1; + */ + protected $gcs_uri_prefix = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_uri_prefix + * The URI prefix. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * The URI prefix. + * + * Generated from protobuf field string gcs_uri_prefix = 1; + * @return string + */ + public function getGcsUriPrefix() + { + return $this->gcs_uri_prefix; + } + + /** + * The URI prefix. + * + * Generated from protobuf field string gcs_uri_prefix = 1; + * @param string $var + * @return $this + */ + public function setGcsUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->gcs_uri_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetEvaluationRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetEvaluationRequest.php new file mode 100644 index 000000000000..6f2655e51233 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetEvaluationRequest.php @@ -0,0 +1,91 @@ +google.cloud.documentai.v1.GetEvaluationRequest + */ +class GetEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * Please see {@see DocumentProcessorServiceClient::evaluationName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\GetEvaluationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorRequest.php new file mode 100644 index 000000000000..400d45124693 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorRequest.php @@ -0,0 +1,83 @@ +google.cloud.documentai.v1.GetProcessorRequest + */ +class GetProcessorRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The processor resource name. Please see + * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\GetProcessorRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor resource name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorTypeRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorTypeRequest.php new file mode 100644 index 000000000000..3ff3084db365 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorTypeRequest.php @@ -0,0 +1,83 @@ +google.cloud.documentai.v1.GetProcessorTypeRequest + */ +class GetProcessorTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor type resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The processor type resource name. Please see + * {@see DocumentProcessorServiceClient::processorTypeName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\GetProcessorTypeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor type resource name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor type resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor type resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorVersionRequest.php new file mode 100644 index 000000000000..626c849fa822 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorVersionRequest.php @@ -0,0 +1,83 @@ +google.cloud.documentai.v1.GetProcessorVersionRequest + */ +class GetProcessorVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The processor resource name. Please see + * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\GetProcessorVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor resource name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor resource name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus.php new file mode 100644 index 000000000000..7c7e15d95aac --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus.php @@ -0,0 +1,155 @@ +google.cloud.documentai.v1.HumanReviewStatus + */ +class HumanReviewStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The state of human review on the processing request. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus.State state = 1; + */ + protected $state = 0; + /** + * A message providing more details about the human review state. + * + * Generated from protobuf field string state_message = 2; + */ + protected $state_message = ''; + /** + * The name of the operation triggered by the processed document. This field + * is populated only when the + * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + * the long-running operation returned by + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + * + * Generated from protobuf field string human_review_operation = 3; + */ + protected $human_review_operation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The state of human review on the processing request. + * @type string $state_message + * A message providing more details about the human review state. + * @type string $human_review_operation + * The name of the operation triggered by the processed document. This field + * is populated only when the + * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + * the long-running operation returned by + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The state of human review on the processing request. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of human review on the processing request. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\HumanReviewStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * A message providing more details about the human review state. + * + * Generated from protobuf field string state_message = 2; + * @return string + */ + public function getStateMessage() + { + return $this->state_message; + } + + /** + * A message providing more details about the human review state. + * + * Generated from protobuf field string state_message = 2; + * @param string $var + * @return $this + */ + public function setStateMessage($var) + { + GPBUtil::checkString($var, True); + $this->state_message = $var; + + return $this; + } + + /** + * The name of the operation triggered by the processed document. This field + * is populated only when the + * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + * the long-running operation returned by + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + * + * Generated from protobuf field string human_review_operation = 3; + * @return string + */ + public function getHumanReviewOperation() + { + return $this->human_review_operation; + } + + /** + * The name of the operation triggered by the processed document. This field + * is populated only when the + * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is + * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as + * the long-running operation returned by + * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. + * + * Generated from protobuf field string human_review_operation = 3; + * @param string $var + * @return $this + */ + public function setHumanReviewOperation($var) + { + GPBUtil::checkString($var, True); + $this->human_review_operation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus/State.php new file mode 100644 index 000000000000..1c83b273fd8c --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus/State.php @@ -0,0 +1,82 @@ +google.cloud.documentai.v1.HumanReviewStatus.State + */ +class State +{ + /** + * Human review state is unspecified. Most likely due to an internal error. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Human review is skipped for the document. This can happen because human + * review isn't enabled on the processor or the processing request has + * been set to skip this document. + * + * Generated from protobuf enum SKIPPED = 1; + */ + const SKIPPED = 1; + /** + * Human review validation is triggered and passed, so no review is needed. + * + * Generated from protobuf enum VALIDATION_PASSED = 2; + */ + const VALIDATION_PASSED = 2; + /** + * Human review validation is triggered and the document is under review. + * + * Generated from protobuf enum IN_PROGRESS = 3; + */ + const IN_PROGRESS = 3; + /** + * Some error happened during triggering human review, see the + * [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message] + * for details. + * + * Generated from protobuf enum ERROR = 4; + */ + const ERROR = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::SKIPPED => 'SKIPPED', + self::VALIDATION_PASSED => 'VALIDATION_PASSED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\DocumentAI\V1\HumanReviewStatus_State::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsRequest.php new file mode 100644 index 000000000000..807389a4e80c --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsRequest.php @@ -0,0 +1,177 @@ +google.cloud.documentai.v1.ListEvaluationsRequest + */ +class ListEvaluationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The standard list page size. + * If unspecified, at most `5` evaluations are returned. + * The maximum value is `100`. Values above `100` are coerced to `100`. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\ListEvaluationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @type int $page_size + * The standard list page size. + * If unspecified, at most `5` evaluations are returned. + * The maximum value is `100`. Values above `100` are coerced to `100`. + * @type string $page_token + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The standard list page size. + * If unspecified, at most `5` evaluations are returned. + * The maximum value is `100`. Values above `100` are coerced to `100`. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The standard list page size. + * If unspecified, at most `5` evaluations are returned. + * The maximum value is `100`. Values above `100` are coerced to `100`. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsResponse.php new file mode 100644 index 000000000000..50718a220119 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsResponse.php @@ -0,0 +1,105 @@ +google.cloud.documentai.v1.ListEvaluationsResponse + */ +class ListEvaluationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The evaluations requested. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + */ + private $evaluations; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Evaluation>|\Google\Protobuf\Internal\RepeatedField $evaluations + * The evaluations requested. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The evaluations requested. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEvaluations() + { + return $this->evaluations; + } + + /** + * The evaluations requested. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Evaluation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEvaluations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Evaluation::class); + $this->evaluations = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesRequest.php new file mode 100644 index 000000000000..8376d2a3fdbd --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesRequest.php @@ -0,0 +1,165 @@ +google.cloud.documentai.v1.ListProcessorTypesRequest + */ +class ListProcessorTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of processor types to return. + * If unspecified, at most `100` processor types will be returned. + * The maximum value is `500`. Values above `500` will be coerced to `500`. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Used to retrieve the next page of results, empty if at the end of the list. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. Please see + * {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\ListProcessorTypesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @type int $page_size + * The maximum number of processor types to return. + * If unspecified, at most `100` processor types will be returned. + * The maximum value is `500`. Values above `500` will be coerced to `500`. + * @type string $page_token + * Used to retrieve the next page of results, empty if at the end of the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of processor types to return. + * If unspecified, at most `100` processor types will be returned. + * The maximum value is `500`. Values above `500` will be coerced to `500`. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of processor types to return. + * If unspecified, at most `100` processor types will be returned. + * The maximum value is `500`. Values above `500` will be coerced to `500`. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Used to retrieve the next page of results, empty if at the end of the list. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Used to retrieve the next page of results, empty if at the end of the list. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesResponse.php new file mode 100644 index 000000000000..2ab8fbb8ffa7 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesResponse.php @@ -0,0 +1,103 @@ +google.cloud.documentai.v1.ListProcessorTypesResponse + */ +class ListProcessorTypesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The processor types. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + */ + private $processor_types; + /** + * Points to the next page, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $processor_types + * The processor types. + * @type string $next_page_token + * Points to the next page, otherwise empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The processor types. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProcessorTypes() + { + return $this->processor_types; + } + + /** + * The processor types. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; + * @param array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProcessorTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorType::class); + $this->processor_types = $arr; + + return $this; + } + + /** + * Points to the next page, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Points to the next page, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsRequest.php new file mode 100644 index 000000000000..2eb32ebdb5cd --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsRequest.php @@ -0,0 +1,171 @@ +google.cloud.documentai.v1.ListProcessorVersionsRequest + */ +class ListProcessorVersionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of processor versions to return. + * If unspecified, at most `10` processor versions will be returned. + * The maximum value is `20`. Values above `20` will be coerced to `20`. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * Please see {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\ListProcessorVersionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @type int $page_size + * The maximum number of processor versions to return. + * If unspecified, at most `10` processor versions will be returned. + * The maximum value is `20`. Values above `20` will be coerced to `20`. + * @type string $page_token + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of processor versions to return. + * If unspecified, at most `10` processor versions will be returned. + * The maximum value is `20`. Values above `20` will be coerced to `20`. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of processor versions to return. + * If unspecified, at most `10` processor versions will be returned. + * The maximum value is `20`. Values above `20` will be coerced to `20`. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsResponse.php new file mode 100644 index 000000000000..b5b6b73704e1 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsResponse.php @@ -0,0 +1,103 @@ +google.cloud.documentai.v1.ListProcessorVersionsResponse + */ +class ListProcessorVersionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of processors. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + */ + private $processor_versions; + /** + * Points to the next processor, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\ProcessorVersion>|\Google\Protobuf\Internal\RepeatedField $processor_versions + * The list of processors. + * @type string $next_page_token + * Points to the next processor, otherwise empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The list of processors. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProcessorVersions() + { + return $this->processor_versions; + } + + /** + * The list of processors. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; + * @param array<\Google\Cloud\DocumentAI\V1\ProcessorVersion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProcessorVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorVersion::class); + $this->processor_versions = $arr; + + return $this; + } + + /** + * Points to the next processor, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Points to the next processor, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsRequest.php new file mode 100644 index 000000000000..2b4335b85480 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsRequest.php @@ -0,0 +1,166 @@ +google.cloud.documentai.v1.ListProcessorsRequest + */ +class ListProcessorsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of processors to return. + * If unspecified, at most `50` processors will be returned. + * The maximum value is `100`. Values above `100` will be coerced to `100`. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * Please see {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\ListProcessorsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @type int $page_size + * The maximum number of processors to return. + * If unspecified, at most `50` processors will be returned. + * The maximum value is `100`. Values above `100` will be coerced to `100`. + * @type string $page_token + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of processors to return. + * If unspecified, at most `50` processors will be returned. + * The maximum value is `100`. Values above `100` will be coerced to `100`. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of processors to return. + * If unspecified, at most `50` processors will be returned. + * The maximum value is `100`. Values above `100` will be coerced to `100`. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsResponse.php new file mode 100644 index 000000000000..c92d36758eb2 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsResponse.php @@ -0,0 +1,103 @@ +google.cloud.documentai.v1.ListProcessorsResponse + */ +class ListProcessorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of processors. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; + */ + private $processors; + /** + * Points to the next processor, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DocumentAI\V1\Processor>|\Google\Protobuf\Internal\RepeatedField $processors + * The list of processors. + * @type string $next_page_token + * Points to the next processor, otherwise empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The list of processors. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProcessors() + { + return $this->processors; + } + + /** + * The list of processors. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; + * @param array<\Google\Cloud\DocumentAI\V1\Processor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProcessors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Processor::class); + $this->processors = $arr; + + return $this; + } + + /** + * Points to the next processor, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Points to the next processor, otherwise empty. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/NormalizedVertex.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/NormalizedVertex.php new file mode 100644 index 000000000000..a283c6a9b7c2 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/NormalizedVertex.php @@ -0,0 +1,103 @@ +google.cloud.documentai.v1.NormalizedVertex + */ +class NormalizedVertex extends \Google\Protobuf\Internal\Message +{ + /** + * X coordinate. + * + * Generated from protobuf field float x = 1; + */ + protected $x = 0.0; + /** + * Y coordinate (starts from the top of the image). + * + * Generated from protobuf field float y = 2; + */ + protected $y = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $x + * X coordinate. + * @type float $y + * Y coordinate (starts from the top of the image). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Geometry::initOnce(); + parent::__construct($data); + } + + /** + * X coordinate. + * + * Generated from protobuf field float x = 1; + * @return float + */ + public function getX() + { + return $this->x; + } + + /** + * X coordinate. + * + * Generated from protobuf field float x = 1; + * @param float $var + * @return $this + */ + public function setX($var) + { + GPBUtil::checkFloat($var); + $this->x = $var; + + return $this; + } + + /** + * Y coordinate (starts from the top of the image). + * + * Generated from protobuf field float y = 2; + * @return float + */ + public function getY() + { + return $this->y; + } + + /** + * Y coordinate (starts from the top of the image). + * + * Generated from protobuf field float y = 2; + * @param float $var + * @return $this + */ + public function setY($var) + { + GPBUtil::checkFloat($var); + $this->y = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig.php new file mode 100644 index 000000000000..fe85b30cb232 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig.php @@ -0,0 +1,378 @@ +google.cloud.documentai.v1.OcrConfig + */ +class OcrConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Hints for the OCR model. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.Hints hints = 2; + */ + protected $hints = null; + /** + * Enables special handling for PDFs with existing text information. Results + * in better text extraction quality in such PDF inputs. + * + * Generated from protobuf field bool enable_native_pdf_parsing = 3; + */ + protected $enable_native_pdf_parsing = false; + /** + * Enables intelligent document quality scores after OCR. Can help with + * diagnosing why OCR responses are of poor quality for a given input. + * Adds additional latency comparable to regular OCR to the process call. + * + * Generated from protobuf field bool enable_image_quality_scores = 4; + */ + protected $enable_image_quality_scores = false; + /** + * A list of advanced OCR options to further fine-tune OCR behavior. Current + * valid values are: + * - `legacy_layout`: a heuristics layout detection algorithm, which serves as + * an alternative to the current ML-based layout detection algorithm. + * Customers can choose the best suitable layout algorithm based on their + * situation. + * + * Generated from protobuf field repeated string advanced_ocr_options = 5; + */ + private $advanced_ocr_options; + /** + * Includes symbol level OCR information if set to true. + * + * Generated from protobuf field bool enable_symbol = 6; + */ + protected $enable_symbol = false; + /** + * Turn on font identification model and return font style information. + * Deprecated, use + * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + * instead. + * + * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; + * @deprecated + */ + protected $compute_style_info = false; + /** + * Turn off character box detector in OCR engine. Character box detection is + * enabled by default in OCR 2.0 (and later) processors. + * + * Generated from protobuf field bool disable_character_boxes_detection = 10; + */ + protected $disable_character_boxes_detection = false; + /** + * Configurations for premium OCR features. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; + */ + protected $premium_features = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\OcrConfig\Hints $hints + * Hints for the OCR model. + * @type bool $enable_native_pdf_parsing + * Enables special handling for PDFs with existing text information. Results + * in better text extraction quality in such PDF inputs. + * @type bool $enable_image_quality_scores + * Enables intelligent document quality scores after OCR. Can help with + * diagnosing why OCR responses are of poor quality for a given input. + * Adds additional latency comparable to regular OCR to the process call. + * @type array|\Google\Protobuf\Internal\RepeatedField $advanced_ocr_options + * A list of advanced OCR options to further fine-tune OCR behavior. Current + * valid values are: + * - `legacy_layout`: a heuristics layout detection algorithm, which serves as + * an alternative to the current ML-based layout detection algorithm. + * Customers can choose the best suitable layout algorithm based on their + * situation. + * @type bool $enable_symbol + * Includes symbol level OCR information if set to true. + * @type bool $compute_style_info + * Turn on font identification model and return font style information. + * Deprecated, use + * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + * instead. + * @type bool $disable_character_boxes_detection + * Turn off character box detector in OCR engine. Character box detection is + * enabled by default in OCR 2.0 (and later) processors. + * @type \Google\Cloud\DocumentAI\V1\OcrConfig\PremiumFeatures $premium_features + * Configurations for premium OCR features. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * Hints for the OCR model. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.Hints hints = 2; + * @return \Google\Cloud\DocumentAI\V1\OcrConfig\Hints|null + */ + public function getHints() + { + return $this->hints; + } + + public function hasHints() + { + return isset($this->hints); + } + + public function clearHints() + { + unset($this->hints); + } + + /** + * Hints for the OCR model. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.Hints hints = 2; + * @param \Google\Cloud\DocumentAI\V1\OcrConfig\Hints $var + * @return $this + */ + public function setHints($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\OcrConfig\Hints::class); + $this->hints = $var; + + return $this; + } + + /** + * Enables special handling for PDFs with existing text information. Results + * in better text extraction quality in such PDF inputs. + * + * Generated from protobuf field bool enable_native_pdf_parsing = 3; + * @return bool + */ + public function getEnableNativePdfParsing() + { + return $this->enable_native_pdf_parsing; + } + + /** + * Enables special handling for PDFs with existing text information. Results + * in better text extraction quality in such PDF inputs. + * + * Generated from protobuf field bool enable_native_pdf_parsing = 3; + * @param bool $var + * @return $this + */ + public function setEnableNativePdfParsing($var) + { + GPBUtil::checkBool($var); + $this->enable_native_pdf_parsing = $var; + + return $this; + } + + /** + * Enables intelligent document quality scores after OCR. Can help with + * diagnosing why OCR responses are of poor quality for a given input. + * Adds additional latency comparable to regular OCR to the process call. + * + * Generated from protobuf field bool enable_image_quality_scores = 4; + * @return bool + */ + public function getEnableImageQualityScores() + { + return $this->enable_image_quality_scores; + } + + /** + * Enables intelligent document quality scores after OCR. Can help with + * diagnosing why OCR responses are of poor quality for a given input. + * Adds additional latency comparable to regular OCR to the process call. + * + * Generated from protobuf field bool enable_image_quality_scores = 4; + * @param bool $var + * @return $this + */ + public function setEnableImageQualityScores($var) + { + GPBUtil::checkBool($var); + $this->enable_image_quality_scores = $var; + + return $this; + } + + /** + * A list of advanced OCR options to further fine-tune OCR behavior. Current + * valid values are: + * - `legacy_layout`: a heuristics layout detection algorithm, which serves as + * an alternative to the current ML-based layout detection algorithm. + * Customers can choose the best suitable layout algorithm based on their + * situation. + * + * Generated from protobuf field repeated string advanced_ocr_options = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvancedOcrOptions() + { + return $this->advanced_ocr_options; + } + + /** + * A list of advanced OCR options to further fine-tune OCR behavior. Current + * valid values are: + * - `legacy_layout`: a heuristics layout detection algorithm, which serves as + * an alternative to the current ML-based layout detection algorithm. + * Customers can choose the best suitable layout algorithm based on their + * situation. + * + * Generated from protobuf field repeated string advanced_ocr_options = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvancedOcrOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->advanced_ocr_options = $arr; + + return $this; + } + + /** + * Includes symbol level OCR information if set to true. + * + * Generated from protobuf field bool enable_symbol = 6; + * @return bool + */ + public function getEnableSymbol() + { + return $this->enable_symbol; + } + + /** + * Includes symbol level OCR information if set to true. + * + * Generated from protobuf field bool enable_symbol = 6; + * @param bool $var + * @return $this + */ + public function setEnableSymbol($var) + { + GPBUtil::checkBool($var); + $this->enable_symbol = $var; + + return $this; + } + + /** + * Turn on font identification model and return font style information. + * Deprecated, use + * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + * instead. + * + * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getComputeStyleInfo() + { + @trigger_error('compute_style_info is deprecated.', E_USER_DEPRECATED); + return $this->compute_style_info; + } + + /** + * Turn on font identification model and return font style information. + * Deprecated, use + * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] + * instead. + * + * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setComputeStyleInfo($var) + { + @trigger_error('compute_style_info is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->compute_style_info = $var; + + return $this; + } + + /** + * Turn off character box detector in OCR engine. Character box detection is + * enabled by default in OCR 2.0 (and later) processors. + * + * Generated from protobuf field bool disable_character_boxes_detection = 10; + * @return bool + */ + public function getDisableCharacterBoxesDetection() + { + return $this->disable_character_boxes_detection; + } + + /** + * Turn off character box detector in OCR engine. Character box detection is + * enabled by default in OCR 2.0 (and later) processors. + * + * Generated from protobuf field bool disable_character_boxes_detection = 10; + * @param bool $var + * @return $this + */ + public function setDisableCharacterBoxesDetection($var) + { + GPBUtil::checkBool($var); + $this->disable_character_boxes_detection = $var; + + return $this; + } + + /** + * Configurations for premium OCR features. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; + * @return \Google\Cloud\DocumentAI\V1\OcrConfig\PremiumFeatures|null + */ + public function getPremiumFeatures() + { + return $this->premium_features; + } + + public function hasPremiumFeatures() + { + return isset($this->premium_features); + } + + public function clearPremiumFeatures() + { + unset($this->premium_features); + } + + /** + * Configurations for premium OCR features. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; + * @param \Google\Cloud\DocumentAI\V1\OcrConfig\PremiumFeatures $var + * @return $this + */ + public function setPremiumFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\OcrConfig\PremiumFeatures::class); + $this->premium_features = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/Hints.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/Hints.php new file mode 100644 index 000000000000..1e0be646e760 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/Hints.php @@ -0,0 +1,90 @@ +google.cloud.documentai.v1.OcrConfig.Hints + */ +class Hints extends \Google\Protobuf\Internal\Message +{ + /** + * List of BCP-47 language codes to use for OCR. In most cases, not + * specifying it yields the best results since it enables automatic language + * detection. For languages based on the Latin alphabet, setting hints is + * not needed. In rare cases, when the language of the text in the + * image is known, setting a hint will help get better results (although it + * will be a significant hindrance if the hint is wrong). + * + * Generated from protobuf field repeated string language_hints = 1; + */ + private $language_hints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $language_hints + * List of BCP-47 language codes to use for OCR. In most cases, not + * specifying it yields the best results since it enables automatic language + * detection. For languages based on the Latin alphabet, setting hints is + * not needed. In rare cases, when the language of the text in the + * image is known, setting a hint will help get better results (although it + * will be a significant hindrance if the hint is wrong). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * List of BCP-47 language codes to use for OCR. In most cases, not + * specifying it yields the best results since it enables automatic language + * detection. For languages based on the Latin alphabet, setting hints is + * not needed. In rare cases, when the language of the text in the + * image is known, setting a hint will help get better results (although it + * will be a significant hindrance if the hint is wrong). + * + * Generated from protobuf field repeated string language_hints = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLanguageHints() + { + return $this->language_hints; + } + + /** + * List of BCP-47 language codes to use for OCR. In most cases, not + * specifying it yields the best results since it enables automatic language + * detection. For languages based on the Latin alphabet, setting hints is + * not needed. In rare cases, when the language of the text in the + * image is known, setting a hint will help get better results (although it + * will be a significant hindrance if the hint is wrong). + * + * Generated from protobuf field repeated string language_hints = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLanguageHints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->language_hints = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Hints::class, \Google\Cloud\DocumentAI\V1\OcrConfig_Hints::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/PremiumFeatures.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/PremiumFeatures.php new file mode 100644 index 000000000000..7de94440773c --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/PremiumFeatures.php @@ -0,0 +1,142 @@ +google.cloud.documentai.v1.OcrConfig.PremiumFeatures + */ +class PremiumFeatures extends \Google\Protobuf\Internal\Message +{ + /** + * Turn on selection mark detector in OCR engine. Only available in OCR 2.0 + * (and later) processors. + * + * Generated from protobuf field bool enable_selection_mark_detection = 3; + */ + protected $enable_selection_mark_detection = false; + /** + * Turn on font identification model and return font style information. + * + * Generated from protobuf field bool compute_style_info = 4; + */ + protected $compute_style_info = false; + /** + * Turn on the model that can extract LaTeX math formulas. + * + * Generated from protobuf field bool enable_math_ocr = 5; + */ + protected $enable_math_ocr = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_selection_mark_detection + * Turn on selection mark detector in OCR engine. Only available in OCR 2.0 + * (and later) processors. + * @type bool $compute_style_info + * Turn on font identification model and return font style information. + * @type bool $enable_math_ocr + * Turn on the model that can extract LaTeX math formulas. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * Turn on selection mark detector in OCR engine. Only available in OCR 2.0 + * (and later) processors. + * + * Generated from protobuf field bool enable_selection_mark_detection = 3; + * @return bool + */ + public function getEnableSelectionMarkDetection() + { + return $this->enable_selection_mark_detection; + } + + /** + * Turn on selection mark detector in OCR engine. Only available in OCR 2.0 + * (and later) processors. + * + * Generated from protobuf field bool enable_selection_mark_detection = 3; + * @param bool $var + * @return $this + */ + public function setEnableSelectionMarkDetection($var) + { + GPBUtil::checkBool($var); + $this->enable_selection_mark_detection = $var; + + return $this; + } + + /** + * Turn on font identification model and return font style information. + * + * Generated from protobuf field bool compute_style_info = 4; + * @return bool + */ + public function getComputeStyleInfo() + { + return $this->compute_style_info; + } + + /** + * Turn on font identification model and return font style information. + * + * Generated from protobuf field bool compute_style_info = 4; + * @param bool $var + * @return $this + */ + public function setComputeStyleInfo($var) + { + GPBUtil::checkBool($var); + $this->compute_style_info = $var; + + return $this; + } + + /** + * Turn on the model that can extract LaTeX math formulas. + * + * Generated from protobuf field bool enable_math_ocr = 5; + * @return bool + */ + public function getEnableMathOcr() + { + return $this->enable_math_ocr; + } + + /** + * Turn on the model that can extract LaTeX math formulas. + * + * Generated from protobuf field bool enable_math_ocr = 5; + * @param bool $var + * @return $this + */ + public function setEnableMathOcr($var) + { + GPBUtil::checkBool($var); + $this->enable_math_ocr = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PremiumFeatures::class, \Google\Cloud\DocumentAI\V1\OcrConfig_PremiumFeatures::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions.php new file mode 100644 index 000000000000..57efd2bf2b73 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions.php @@ -0,0 +1,300 @@ +google.cloud.documentai.v1.ProcessOptions + */ +class ProcessOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig ocr_config = 1; + */ + protected $ocr_config = null; + /** + * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $layout_config = null; + /** + * Optional. Override the schema of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + * return an Invalid Argument error if this field is set when the underlying + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + * support schema override. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schema_override = null; + protected $page_range; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\ProcessOptions\IndividualPageSelector $individual_page_selector + * Which pages to process (1-indexed). + * @type int $from_start + * Only process certain pages from the start. Process all if the document + * has fewer pages. + * @type int $from_end + * Only process certain pages from the end, same as above. + * @type \Google\Cloud\DocumentAI\V1\OcrConfig $ocr_config + * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * @type \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig $layout_config + * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $schema_override + * Optional. Override the schema of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + * return an Invalid Argument error if this field is set when the underlying + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + * support schema override. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Which pages to process (1-indexed). + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector individual_page_selector = 5; + * @return \Google\Cloud\DocumentAI\V1\ProcessOptions\IndividualPageSelector|null + */ + public function getIndividualPageSelector() + { + return $this->readOneof(5); + } + + public function hasIndividualPageSelector() + { + return $this->hasOneof(5); + } + + /** + * Which pages to process (1-indexed). + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector individual_page_selector = 5; + * @param \Google\Cloud\DocumentAI\V1\ProcessOptions\IndividualPageSelector $var + * @return $this + */ + public function setIndividualPageSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions\IndividualPageSelector::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Only process certain pages from the start. Process all if the document + * has fewer pages. + * + * Generated from protobuf field int32 from_start = 6; + * @return int + */ + public function getFromStart() + { + return $this->readOneof(6); + } + + public function hasFromStart() + { + return $this->hasOneof(6); + } + + /** + * Only process certain pages from the start. Process all if the document + * has fewer pages. + * + * Generated from protobuf field int32 from_start = 6; + * @param int $var + * @return $this + */ + public function setFromStart($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Only process certain pages from the end, same as above. + * + * Generated from protobuf field int32 from_end = 7; + * @return int + */ + public function getFromEnd() + { + return $this->readOneof(7); + } + + public function hasFromEnd() + { + return $this->hasOneof(7); + } + + /** + * Only process certain pages from the end, same as above. + * + * Generated from protobuf field int32 from_end = 7; + * @param int $var + * @return $this + */ + public function setFromEnd($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig ocr_config = 1; + * @return \Google\Cloud\DocumentAI\V1\OcrConfig|null + */ + public function getOcrConfig() + { + return $this->ocr_config; + } + + public function hasOcrConfig() + { + return isset($this->ocr_config); + } + + public function clearOcrConfig() + { + unset($this->ocr_config); + } + + /** + * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig ocr_config = 1; + * @param \Google\Cloud\DocumentAI\V1\OcrConfig $var + * @return $this + */ + public function setOcrConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\OcrConfig::class); + $this->ocr_config = $var; + + return $this; + } + + /** + * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig|null + */ + public function getLayoutConfig() + { + return $this->layout_config; + } + + public function hasLayoutConfig() + { + return isset($this->layout_config); + } + + public function clearLayoutConfig() + { + unset($this->layout_config); + } + + /** + * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. + * Returns error if set on other processor types. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig $var + * @return $this + */ + public function setLayoutConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig::class); + $this->layout_config = $var; + + return $this; + } + + /** + * Optional. Override the schema of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + * return an Invalid Argument error if this field is set when the underlying + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + * support schema override. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null + */ + public function getSchemaOverride() + { + return $this->schema_override; + } + + public function hasSchemaOverride() + { + return isset($this->schema_override); + } + + public function clearSchemaOverride() + { + unset($this->schema_override); + } + + /** + * Optional. Override the schema of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will + * return an Invalid Argument error if this field is set when the underlying + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't + * support schema override. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var + * @return $this + */ + public function setSchemaOverride($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema::class); + $this->schema_override = $var; + + return $this; + } + + /** + * @return string + */ + public function getPageRange() + { + return $this->whichOneof("page_range"); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/IndividualPageSelector.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/IndividualPageSelector.php new file mode 100644 index 000000000000..40cdb2cac3df --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/IndividualPageSelector.php @@ -0,0 +1,70 @@ +google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + */ +class IndividualPageSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Indices of the pages (starting from 1). + * + * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $pages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $pages + * Optional. Indices of the pages (starting from 1). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Indices of the pages (starting from 1). + * + * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPages() + { + return $this->pages; + } + + /** + * Optional. Indices of the pages (starting from 1). + * + * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->pages = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IndividualPageSelector::class, \Google\Cloud\DocumentAI\V1\ProcessOptions_IndividualPageSelector::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig.php new file mode 100644 index 000000000000..7b809cd9b86c --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig.php @@ -0,0 +1,80 @@ +google.cloud.documentai.v1.ProcessOptions.LayoutConfig + */ +class LayoutConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Config for chunking in layout parser processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $chunking_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig $chunking_config + * Optional. Config for chunking in layout parser processor. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Config for chunking in layout parser processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig|null + */ + public function getChunkingConfig() + { + return $this->chunking_config; + } + + public function hasChunkingConfig() + { + return isset($this->chunking_config); + } + + public function clearChunkingConfig() + { + unset($this->chunking_config); + } + + /** + * Optional. Config for chunking in layout parser processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig $var + * @return $this + */ + public function setChunkingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig::class); + $this->chunking_config = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LayoutConfig::class, \Google\Cloud\DocumentAI\V1\ProcessOptions_LayoutConfig::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php new file mode 100644 index 000000000000..eb6139b1159d --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php @@ -0,0 +1,108 @@ +google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + */ +class ChunkingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The chunk sizes to use when splitting documents, in order of + * level. + * + * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $chunk_size = 0; + /** + * Optional. Whether or not to include ancestor headings when splitting. + * + * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $include_ancestor_headings = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $chunk_size + * Optional. The chunk sizes to use when splitting documents, in order of + * level. + * @type bool $include_ancestor_headings + * Optional. Whether or not to include ancestor headings when splitting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The chunk sizes to use when splitting documents, in order of + * level. + * + * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getChunkSize() + { + return $this->chunk_size; + } + + /** + * Optional. The chunk sizes to use when splitting documents, in order of + * level. + * + * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setChunkSize($var) + { + GPBUtil::checkInt32($var); + $this->chunk_size = $var; + + return $this; + } + + /** + * Optional. Whether or not to include ancestor headings when splitting. + * + * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIncludeAncestorHeadings() + { + return $this->include_ancestor_headings; + } + + /** + * Optional. Whether or not to include ancestor headings when splitting. + * + * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIncludeAncestorHeadings($var) + { + GPBUtil::checkBool($var); + $this->include_ancestor_headings = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ChunkingConfig::class, \Google\Cloud\DocumentAI\V1\ProcessOptions_LayoutConfig_ChunkingConfig::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessRequest.php new file mode 100644 index 000000000000..fa157c5cd440 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessRequest.php @@ -0,0 +1,457 @@ +google.cloud.documentai.v1.ProcessRequest + */ +class ProcessRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Whether human review should be skipped for this request. Default to + * `false`. + * + * Generated from protobuf field bool skip_human_review = 3; + */ + protected $skip_human_review = false; + /** + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * output. Only supports top-level document and pages field, so it must be in + * the form of `{document_field_name}` or `pages.{page_field_name}`. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 6; + */ + protected $field_mask = null; + /** + * Inference-time options for the process API + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; + */ + protected $process_options = null; + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Option to remove images from the document. + * + * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $imageless_mode = false; + protected $source; + + /** + * @param string $name Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * @return \Google\Cloud\DocumentAI\V1\ProcessRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document $inline_document + * An inline document proto. + * @type \Google\Cloud\DocumentAI\V1\RawDocument $raw_document + * A raw document content (bytes). + * @type \Google\Cloud\DocumentAI\V1\GcsDocument $gcs_document + * A raw document on Google Cloud Storage. + * @type string $name + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @type bool $skip_human_review + * Whether human review should be skipped for this request. Default to + * `false`. + * @type \Google\Protobuf\FieldMask $field_mask + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * output. Only supports top-level document and pages field, so it must be in + * the form of `{document_field_name}` or `pages.{page_field_name}`. + * @type \Google\Cloud\DocumentAI\V1\ProcessOptions $process_options + * Inference-time options for the process API + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * @type bool $imageless_mode + * Optional. Option to remove images from the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * An inline document proto. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document inline_document = 4; + * @return \Google\Cloud\DocumentAI\V1\Document|null + */ + public function getInlineDocument() + { + return $this->readOneof(4); + } + + public function hasInlineDocument() + { + return $this->hasOneof(4); + } + + /** + * An inline document proto. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document inline_document = 4; + * @param \Google\Cloud\DocumentAI\V1\Document $var + * @return $this + */ + public function setInlineDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A raw document content (bytes). + * + * Generated from protobuf field .google.cloud.documentai.v1.RawDocument raw_document = 5; + * @return \Google\Cloud\DocumentAI\V1\RawDocument|null + */ + public function getRawDocument() + { + return $this->readOneof(5); + } + + public function hasRawDocument() + { + return $this->hasOneof(5); + } + + /** + * A raw document content (bytes). + * + * Generated from protobuf field .google.cloud.documentai.v1.RawDocument raw_document = 5; + * @param \Google\Cloud\DocumentAI\V1\RawDocument $var + * @return $this + */ + public function setRawDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\RawDocument::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * A raw document on Google Cloud Storage. + * + * Generated from protobuf field .google.cloud.documentai.v1.GcsDocument gcs_document = 8; + * @return \Google\Cloud\DocumentAI\V1\GcsDocument|null + */ + public function getGcsDocument() + { + return $this->readOneof(8); + } + + public function hasGcsDocument() + { + return $this->hasOneof(8); + } + + /** + * A raw document on Google Cloud Storage. + * + * Generated from protobuf field .google.cloud.documentai.v1.GcsDocument gcs_document = 8; + * @param \Google\Cloud\DocumentAI\V1\GcsDocument $var + * @return $this + */ + public function setGcsDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\GcsDocument::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Whether human review should be skipped for this request. Default to + * `false`. + * + * Generated from protobuf field bool skip_human_review = 3; + * @return bool + */ + public function getSkipHumanReview() + { + return $this->skip_human_review; + } + + /** + * Whether human review should be skipped for this request. Default to + * `false`. + * + * Generated from protobuf field bool skip_human_review = 3; + * @param bool $var + * @return $this + */ + public function setSkipHumanReview($var) + { + GPBUtil::checkBool($var); + $this->skip_human_review = $var; + + return $this; + } + + /** + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * output. Only supports top-level document and pages field, so it must be in + * the form of `{document_field_name}` or `pages.{page_field_name}`. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 6; + * @return \Google\Protobuf\FieldMask|null + */ + public function getFieldMask() + { + return $this->field_mask; + } + + public function hasFieldMask() + { + return isset($this->field_mask); + } + + public function clearFieldMask() + { + unset($this->field_mask); + } + + /** + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * output. Only supports top-level document and pages field, so it must be in + * the form of `{document_field_name}` or `pages.{page_field_name}`. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 6; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setFieldMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->field_mask = $var; + + return $this; + } + + /** + * Inference-time options for the process API + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * @return \Google\Cloud\DocumentAI\V1\ProcessOptions|null + */ + public function getProcessOptions() + { + return $this->process_options; + } + + public function hasProcessOptions() + { + return isset($this->process_options); + } + + public function clearProcessOptions() + { + unset($this->process_options); + } + + /** + * Inference-time options for the process API + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; + * @param \Google\Cloud\DocumentAI\V1\ProcessOptions $var + * @return $this + */ + public function setProcessOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions::class); + $this->process_options = $var; + + return $this; + } + + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels with user-defined metadata for the request. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Option to remove images from the document. + * + * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getImagelessMode() + { + return $this->imageless_mode; + } + + /** + * Optional. Option to remove images from the document. + * + * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setImagelessMode($var) + { + GPBUtil::checkBool($var); + $this->imageless_mode = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessResponse.php new file mode 100644 index 000000000000..cb8f9c7b8c36 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessResponse.php @@ -0,0 +1,127 @@ +google.cloud.documentai.v1.ProcessResponse + */ +class ProcessResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The document payload, will populate fields based on the processor's + * behavior. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document document = 1; + */ + protected $document = null; + /** + * The status of human review on the processed document. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 3; + */ + protected $human_review_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document $document + * The document payload, will populate fields based on the processor's + * behavior. + * @type \Google\Cloud\DocumentAI\V1\HumanReviewStatus $human_review_status + * The status of human review on the processed document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The document payload, will populate fields based on the processor's + * behavior. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document document = 1; + * @return \Google\Cloud\DocumentAI\V1\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * The document payload, will populate fields based on the processor's + * behavior. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document document = 1; + * @param \Google\Cloud\DocumentAI\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document::class); + $this->document = $var; + + return $this; + } + + /** + * The status of human review on the processed document. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 3; + * @return \Google\Cloud\DocumentAI\V1\HumanReviewStatus|null + */ + public function getHumanReviewStatus() + { + return $this->human_review_status; + } + + public function hasHumanReviewStatus() + { + return isset($this->human_review_status); + } + + public function clearHumanReviewStatus() + { + unset($this->human_review_status); + } + + /** + * The status of human review on the processed document. + * + * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 3; + * @param \Google\Cloud\DocumentAI\V1\HumanReviewStatus $var + * @return $this + */ + public function setHumanReviewStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\HumanReviewStatus::class); + $this->human_review_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor.php new file mode 100644 index 000000000000..4835b189de65 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor.php @@ -0,0 +1,438 @@ +google.cloud.documentai.v1.Processor + */ +class Processor extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Immutable. The resource name of the processor. + * Format: `projects/{project}/locations/{location}/processors/{processor}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + * To get a list of processor types, see + * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. + * + * Generated from protobuf field string type = 2; + */ + protected $type = ''; + /** + * The display name of the processor. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + /** + * Output only. The state of the processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * The default processor version. + * + * Generated from protobuf field string default_processor_version = 9 [(.google.api.resource_reference) = { + */ + protected $default_processor_version = ''; + /** + * Output only. The processor version aliases. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersionAlias processor_version_aliases = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $processor_version_aliases; + /** + * Output only. Immutable. The http endpoint that can be called to invoke + * processing. + * + * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $process_endpoint = ''; + /** + * The time the processor was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + */ + protected $create_time = null; + /** + * The [KMS key](https://cloud.google.com/security-key-management) used for + * encryption and decryption in CMEK scenarios. + * + * Generated from protobuf field string kms_key_name = 8; + */ + protected $kms_key_name = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Immutable. The resource name of the processor. + * Format: `projects/{project}/locations/{location}/processors/{processor}` + * @type string $type + * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + * To get a list of processor types, see + * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. + * @type string $display_name + * The display name of the processor. + * @type int $state + * Output only. The state of the processor. + * @type string $default_processor_version + * The default processor version. + * @type array<\Google\Cloud\DocumentAI\V1\ProcessorVersionAlias>|\Google\Protobuf\Internal\RepeatedField $processor_version_aliases + * Output only. The processor version aliases. + * @type string $process_endpoint + * Output only. Immutable. The http endpoint that can be called to invoke + * processing. + * @type \Google\Protobuf\Timestamp $create_time + * The time the processor was created. + * @type string $kms_key_name + * The [KMS key](https://cloud.google.com/security-key-management) used for + * encryption and decryption in CMEK scenarios. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Immutable. The resource name of the processor. + * Format: `projects/{project}/locations/{location}/processors/{processor}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Immutable. The resource name of the processor. + * Format: `projects/{project}/locations/{location}/processors/{processor}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + * To get a list of processor types, see + * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + * To get a list of processor types, see + * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The display name of the processor. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the processor. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The state of the processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Processor\State::class); + $this->state = $var; + + return $this; + } + + /** + * The default processor version. + * + * Generated from protobuf field string default_processor_version = 9 [(.google.api.resource_reference) = { + * @return string + */ + public function getDefaultProcessorVersion() + { + return $this->default_processor_version; + } + + /** + * The default processor version. + * + * Generated from protobuf field string default_processor_version = 9 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDefaultProcessorVersion($var) + { + GPBUtil::checkString($var, True); + $this->default_processor_version = $var; + + return $this; + } + + /** + * Output only. The processor version aliases. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersionAlias processor_version_aliases = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProcessorVersionAliases() + { + return $this->processor_version_aliases; + } + + /** + * Output only. The processor version aliases. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersionAlias processor_version_aliases = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\DocumentAI\V1\ProcessorVersionAlias>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProcessorVersionAliases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorVersionAlias::class); + $this->processor_version_aliases = $arr; + + return $this; + } + + /** + * Output only. Immutable. The http endpoint that can be called to invoke + * processing. + * + * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getProcessEndpoint() + { + return $this->process_endpoint; + } + + /** + * Output only. Immutable. The http endpoint that can be called to invoke + * processing. + * + * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setProcessEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->process_endpoint = $var; + + return $this; + } + + /** + * The time the processor was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time the processor was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The [KMS key](https://cloud.google.com/security-key-management) used for + * encryption and decryption in CMEK scenarios. + * + * Generated from protobuf field string kms_key_name = 8; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * The [KMS key](https://cloud.google.com/security-key-management) used for + * encryption and decryption in CMEK scenarios. + * + * Generated from protobuf field string kms_key_name = 8; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return $this->satisfies_pzi; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor/State.php new file mode 100644 index 000000000000..4b15938e4a46 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor/State.php @@ -0,0 +1,107 @@ +google.cloud.documentai.v1.Processor.State + */ +class State +{ + /** + * The processor is in an unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The processor is enabled, i.e., has an enabled version which can + * currently serve processing requests and all the feature dependencies have + * been successfully initialized. + * + * Generated from protobuf enum ENABLED = 1; + */ + const ENABLED = 1; + /** + * The processor is disabled. + * + * Generated from protobuf enum DISABLED = 2; + */ + const DISABLED = 2; + /** + * The processor is being enabled, will become `ENABLED` if successful. + * + * Generated from protobuf enum ENABLING = 3; + */ + const ENABLING = 3; + /** + * The processor is being disabled, will become `DISABLED` if successful. + * + * Generated from protobuf enum DISABLING = 4; + */ + const DISABLING = 4; + /** + * The processor is being created, will become either `ENABLED` (for + * successful creation) or `FAILED` (for failed ones). + * Once a processor is in this state, it can then be used for document + * processing, but the feature dependencies of the processor might not be + * fully created yet. + * + * Generated from protobuf enum CREATING = 5; + */ + const CREATING = 5; + /** + * The processor failed during creation or initialization of feature + * dependencies. The user should delete the processor and recreate one as + * all the functionalities of the processor are disabled. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * The processor is being deleted, will be removed if successful. + * + * Generated from protobuf enum DELETING = 7; + */ + const DELETING = 7; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ENABLED => 'ENABLED', + self::DISABLED => 'DISABLED', + self::ENABLING => 'ENABLING', + self::DISABLING => 'DISABLING', + self::CREATING => 'CREATING', + self::FAILED => 'FAILED', + self::DELETING => 'DELETING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\DocumentAI\V1\Processor_State::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType.php new file mode 100644 index 000000000000..2ee18d7a9f8a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType.php @@ -0,0 +1,280 @@ +google.cloud.documentai.v1.ProcessorType + */ +class ProcessorType extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the processor type. + * Format: `projects/{project}/processorTypes/{processor_type}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + * + * Generated from protobuf field string type = 2; + */ + protected $type = ''; + /** + * The processor category, used by UI to group processor types. + * + * Generated from protobuf field string category = 3; + */ + protected $category = ''; + /** + * The locations in which this processor is available. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + */ + private $available_locations; + /** + * Whether the processor type allows creation. If true, users can create a + * processor of this processor type. Otherwise, users need to request access. + * + * Generated from protobuf field bool allow_creation = 6; + */ + protected $allow_creation = false; + /** + * Launch stage of the processor type + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 8; + */ + protected $launch_stage = 0; + /** + * A set of Cloud Storage URIs of sample documents for this processor. + * + * Generated from protobuf field repeated string sample_document_uris = 9; + */ + private $sample_document_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the processor type. + * Format: `projects/{project}/processorTypes/{processor_type}` + * @type string $type + * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + * @type string $category + * The processor category, used by UI to group processor types. + * @type array<\Google\Cloud\DocumentAI\V1\ProcessorType\LocationInfo>|\Google\Protobuf\Internal\RepeatedField $available_locations + * The locations in which this processor is available. + * @type bool $allow_creation + * Whether the processor type allows creation. If true, users can create a + * processor of this processor type. Otherwise, users need to request access. + * @type int $launch_stage + * Launch stage of the processor type + * @type array|\Google\Protobuf\Internal\RepeatedField $sample_document_uris + * A set of Cloud Storage URIs of sample documents for this processor. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\ProcessorType::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the processor type. + * Format: `projects/{project}/processorTypes/{processor_type}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the processor type. + * Format: `projects/{project}/processorTypes/{processor_type}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The processor category, used by UI to group processor types. + * + * Generated from protobuf field string category = 3; + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * The processor category, used by UI to group processor types. + * + * Generated from protobuf field string category = 3; + * @param string $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkString($var, True); + $this->category = $var; + + return $this; + } + + /** + * The locations in which this processor is available. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAvailableLocations() + { + return $this->available_locations; + } + + /** + * The locations in which this processor is available. + * + * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; + * @param array<\Google\Cloud\DocumentAI\V1\ProcessorType\LocationInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAvailableLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorType\LocationInfo::class); + $this->available_locations = $arr; + + return $this; + } + + /** + * Whether the processor type allows creation. If true, users can create a + * processor of this processor type. Otherwise, users need to request access. + * + * Generated from protobuf field bool allow_creation = 6; + * @return bool + */ + public function getAllowCreation() + { + return $this->allow_creation; + } + + /** + * Whether the processor type allows creation. If true, users can create a + * processor of this processor type. Otherwise, users need to request access. + * + * Generated from protobuf field bool allow_creation = 6; + * @param bool $var + * @return $this + */ + public function setAllowCreation($var) + { + GPBUtil::checkBool($var); + $this->allow_creation = $var; + + return $this; + } + + /** + * Launch stage of the processor type + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 8; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * Launch stage of the processor type + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 8; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * A set of Cloud Storage URIs of sample documents for this processor. + * + * Generated from protobuf field repeated string sample_document_uris = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSampleDocumentUris() + { + return $this->sample_document_uris; + } + + /** + * A set of Cloud Storage URIs of sample documents for this processor. + * + * Generated from protobuf field repeated string sample_document_uris = 9; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSampleDocumentUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->sample_document_uris = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType/LocationInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType/LocationInfo.php new file mode 100644 index 000000000000..aff1d4c1493b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType/LocationInfo.php @@ -0,0 +1,74 @@ +google.cloud.documentai.v1.ProcessorType.LocationInfo + */ +class LocationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The location ID. For supported locations, refer to [regional and + * multi-regional support](/document-ai/docs/regions). + * + * Generated from protobuf field string location_id = 1; + */ + protected $location_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $location_id + * The location ID. For supported locations, refer to [regional and + * multi-regional support](/document-ai/docs/regions). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\ProcessorType::initOnce(); + parent::__construct($data); + } + + /** + * The location ID. For supported locations, refer to [regional and + * multi-regional support](/document-ai/docs/regions). + * + * Generated from protobuf field string location_id = 1; + * @return string + */ + public function getLocationId() + { + return $this->location_id; + } + + /** + * The location ID. For supported locations, refer to [regional and + * multi-regional support](/document-ai/docs/regions). + * + * Generated from protobuf field string location_id = 1; + * @param string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkString($var, True); + $this->location_id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LocationInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorType_LocationInfo::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion.php new file mode 100644 index 000000000000..12b86ace960e --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion.php @@ -0,0 +1,574 @@ +google.cloud.documentai.v1.ProcessorVersion + */ +class ProcessorVersion extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the processor version. + * Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * The display name of the processor version. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * The schema of the processor version. Describes the output. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 12; + */ + protected $document_schema = null; + /** + * Output only. The state of the processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * The time the processor version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + */ + protected $create_time = null; + /** + * The most recently invoked evaluation for the processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + */ + protected $latest_evaluation = null; + /** + * The KMS key name used for encryption. + * + * Generated from protobuf field string kms_key_name = 9; + */ + protected $kms_key_name = ''; + /** + * The KMS key version with which data is encrypted. + * + * Generated from protobuf field string kms_key_version_name = 10; + */ + protected $kms_key_version_name = ''; + /** + * Output only. Denotes that this `ProcessorVersion` is managed by Google. + * + * Generated from protobuf field bool google_managed = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $google_managed = false; + /** + * If set, information about the eventual deprecation of this version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + */ + protected $deprecation_info = null; + /** + * Output only. The model type of this processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.ModelType model_type = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $model_type = 0; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = false; + /** + * Output only. Information about Generative AI model-based processor + * versions. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $gen_ai_model_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the processor version. + * Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + * @type string $display_name + * The display name of the processor version. + * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $document_schema + * The schema of the processor version. Describes the output. + * @type int $state + * Output only. The state of the processor version. + * @type \Google\Protobuf\Timestamp $create_time + * The time the processor version was created. + * @type \Google\Cloud\DocumentAI\V1\EvaluationReference $latest_evaluation + * The most recently invoked evaluation for the processor version. + * @type string $kms_key_name + * The KMS key name used for encryption. + * @type string $kms_key_version_name + * The KMS key version with which data is encrypted. + * @type bool $google_managed + * Output only. Denotes that this `ProcessorVersion` is managed by Google. + * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion\DeprecationInfo $deprecation_info + * If set, information about the eventual deprecation of this version. + * @type int $model_type + * Output only. The model type of this processor version. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. + * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo $gen_ai_model_info + * Output only. Information about Generative AI model-based processor + * versions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the processor version. + * Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the processor version. + * Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The display name of the processor version. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the processor version. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The schema of the processor version. Describes the output. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 12; + * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null + */ + public function getDocumentSchema() + { + return $this->document_schema; + } + + public function hasDocumentSchema() + { + return isset($this->document_schema); + } + + public function clearDocumentSchema() + { + unset($this->document_schema); + } + + /** + * The schema of the processor version. Describes the output. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 12; + * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var + * @return $this + */ + public function setDocumentSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema::class); + $this->document_schema = $var; + + return $this; + } + + /** + * Output only. The state of the processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\State::class); + $this->state = $var; + + return $this; + } + + /** + * The time the processor version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time the processor version was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The most recently invoked evaluation for the processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + * @return \Google\Cloud\DocumentAI\V1\EvaluationReference|null + */ + public function getLatestEvaluation() + { + return $this->latest_evaluation; + } + + public function hasLatestEvaluation() + { + return isset($this->latest_evaluation); + } + + public function clearLatestEvaluation() + { + unset($this->latest_evaluation); + } + + /** + * The most recently invoked evaluation for the processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; + * @param \Google\Cloud\DocumentAI\V1\EvaluationReference $var + * @return $this + */ + public function setLatestEvaluation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\EvaluationReference::class); + $this->latest_evaluation = $var; + + return $this; + } + + /** + * The KMS key name used for encryption. + * + * Generated from protobuf field string kms_key_name = 9; + * @return string + */ + public function getKmsKeyName() + { + return $this->kms_key_name; + } + + /** + * The KMS key name used for encryption. + * + * Generated from protobuf field string kms_key_name = 9; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + + /** + * The KMS key version with which data is encrypted. + * + * Generated from protobuf field string kms_key_version_name = 10; + * @return string + */ + public function getKmsKeyVersionName() + { + return $this->kms_key_version_name; + } + + /** + * The KMS key version with which data is encrypted. + * + * Generated from protobuf field string kms_key_version_name = 10; + * @param string $var + * @return $this + */ + public function setKmsKeyVersionName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_version_name = $var; + + return $this; + } + + /** + * Output only. Denotes that this `ProcessorVersion` is managed by Google. + * + * Generated from protobuf field bool google_managed = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getGoogleManaged() + { + return $this->google_managed; + } + + /** + * Output only. Denotes that this `ProcessorVersion` is managed by Google. + * + * Generated from protobuf field bool google_managed = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setGoogleManaged($var) + { + GPBUtil::checkBool($var); + $this->google_managed = $var; + + return $this; + } + + /** + * If set, information about the eventual deprecation of this version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion\DeprecationInfo|null + */ + public function getDeprecationInfo() + { + return $this->deprecation_info; + } + + public function hasDeprecationInfo() + { + return isset($this->deprecation_info); + } + + public function clearDeprecationInfo() + { + unset($this->deprecation_info); + } + + /** + * If set, information about the eventual deprecation of this version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; + * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion\DeprecationInfo $var + * @return $this + */ + public function setDeprecationInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\DeprecationInfo::class); + $this->deprecation_info = $var; + + return $this; + } + + /** + * Output only. The model type of this processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.ModelType model_type = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getModelType() + { + return $this->model_type; + } + + /** + * Output only. The model type of this processor version. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.ModelType model_type = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setModelType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\ModelType::class); + $this->model_type = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return $this->satisfies_pzi; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * Output only. Information about Generative AI model-based processor + * versions. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo|null + */ + public function getGenAiModelInfo() + { + return $this->gen_ai_model_info; + } + + public function hasGenAiModelInfo() + { + return isset($this->gen_ai_model_info); + } + + public function clearGenAiModelInfo() + { + unset($this->gen_ai_model_info); + } + + /** + * Output only. Information about Generative AI model-based processor + * versions. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo $var + * @return $this + */ + public function setGenAiModelInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo::class); + $this->gen_ai_model_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/DeprecationInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/DeprecationInfo.php new file mode 100644 index 000000000000..f6d07ebc1de2 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/DeprecationInfo.php @@ -0,0 +1,114 @@ +google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + */ +class DeprecationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The time at which this processor version will be deprecated. + * + * Generated from protobuf field .google.protobuf.Timestamp deprecation_time = 1; + */ + protected $deprecation_time = null; + /** + * If set, the processor version that will be used as a replacement. + * + * Generated from protobuf field string replacement_processor_version = 2 [(.google.api.resource_reference) = { + */ + protected $replacement_processor_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $deprecation_time + * The time at which this processor version will be deprecated. + * @type string $replacement_processor_version + * If set, the processor version that will be used as a replacement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); + parent::__construct($data); + } + + /** + * The time at which this processor version will be deprecated. + * + * Generated from protobuf field .google.protobuf.Timestamp deprecation_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeprecationTime() + { + return $this->deprecation_time; + } + + public function hasDeprecationTime() + { + return isset($this->deprecation_time); + } + + public function clearDeprecationTime() + { + unset($this->deprecation_time); + } + + /** + * The time at which this processor version will be deprecated. + * + * Generated from protobuf field .google.protobuf.Timestamp deprecation_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeprecationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->deprecation_time = $var; + + return $this; + } + + /** + * If set, the processor version that will be used as a replacement. + * + * Generated from protobuf field string replacement_processor_version = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getReplacementProcessorVersion() + { + return $this->replacement_processor_version; + } + + /** + * If set, the processor version that will be used as a replacement. + * + * Generated from protobuf field string replacement_processor_version = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setReplacementProcessorVersion($var) + { + GPBUtil::checkString($var, True); + $this->replacement_processor_version = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeprecationInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_DeprecationInfo::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo.php new file mode 100644 index 000000000000..668d2517f811 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo.php @@ -0,0 +1,111 @@ +google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + */ +class GenAiModelInfo extends \Google\Protobuf\Internal\Message +{ + protected $model_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\FoundationGenAiModelInfo $foundation_gen_ai_model_info + * Information for a pretrained Google-managed foundation model. + * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\CustomGenAiModelInfo $custom_gen_ai_model_info + * Information for a custom Generative AI model created by the user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); + parent::__construct($data); + } + + /** + * Information for a pretrained Google-managed foundation model. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo foundation_gen_ai_model_info = 1; + * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\FoundationGenAiModelInfo|null + */ + public function getFoundationGenAiModelInfo() + { + return $this->readOneof(1); + } + + public function hasFoundationGenAiModelInfo() + { + return $this->hasOneof(1); + } + + /** + * Information for a pretrained Google-managed foundation model. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo foundation_gen_ai_model_info = 1; + * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\FoundationGenAiModelInfo $var + * @return $this + */ + public function setFoundationGenAiModelInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\FoundationGenAiModelInfo::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Information for a custom Generative AI model created by the user. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo custom_gen_ai_model_info = 2; + * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\CustomGenAiModelInfo|null + */ + public function getCustomGenAiModelInfo() + { + return $this->readOneof(2); + } + + public function hasCustomGenAiModelInfo() + { + return $this->hasOneof(2); + } + + /** + * Information for a custom Generative AI model created by the user. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo custom_gen_ai_model_info = 2; + * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\CustomGenAiModelInfo $var + * @return $this + */ + public function setCustomGenAiModelInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\CustomGenAiModelInfo::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getModelInfo() + { + return $this->whichOneof("model_info"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GenAiModelInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_GenAiModelInfo::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php new file mode 100644 index 000000000000..886298d2f206 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php @@ -0,0 +1,106 @@ +google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + */ +class CustomGenAiModelInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The type of custom model created by the user. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType custom_model_type = 1; + */ + protected $custom_model_type = 0; + /** + * The base processor version ID for the custom model. + * + * Generated from protobuf field string base_processor_version_id = 2; + */ + protected $base_processor_version_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $custom_model_type + * The type of custom model created by the user. + * @type string $base_processor_version_id + * The base processor version ID for the custom model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); + parent::__construct($data); + } + + /** + * The type of custom model created by the user. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType custom_model_type = 1; + * @return int + */ + public function getCustomModelType() + { + return $this->custom_model_type; + } + + /** + * The type of custom model created by the user. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType custom_model_type = 1; + * @param int $var + * @return $this + */ + public function setCustomModelType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo\CustomGenAiModelInfo\CustomModelType::class); + $this->custom_model_type = $var; + + return $this; + } + + /** + * The base processor version ID for the custom model. + * + * Generated from protobuf field string base_processor_version_id = 2; + * @return string + */ + public function getBaseProcessorVersionId() + { + return $this->base_processor_version_id; + } + + /** + * The base processor version ID for the custom model. + * + * Generated from protobuf field string base_processor_version_id = 2; + * @param string $var + * @return $this + */ + public function setBaseProcessorVersionId($var) + { + GPBUtil::checkString($var, True); + $this->base_processor_version_id = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CustomGenAiModelInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_GenAiModelInfo_CustomGenAiModelInfo::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php new file mode 100644 index 000000000000..7b813eb078d9 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php @@ -0,0 +1,64 @@ +google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType + */ +class CustomModelType +{ + /** + * The model type is unspecified. + * + * Generated from protobuf enum CUSTOM_MODEL_TYPE_UNSPECIFIED = 0; + */ + const CUSTOM_MODEL_TYPE_UNSPECIFIED = 0; + /** + * The model is a versioned foundation model. + * + * Generated from protobuf enum VERSIONED_FOUNDATION = 1; + */ + const VERSIONED_FOUNDATION = 1; + /** + * The model is a finetuned foundation model. + * + * Generated from protobuf enum FINE_TUNED = 2; + */ + const FINE_TUNED = 2; + + private static $valueToName = [ + self::CUSTOM_MODEL_TYPE_UNSPECIFIED => 'CUSTOM_MODEL_TYPE_UNSPECIFIED', + self::VERSIONED_FOUNDATION => 'VERSIONED_FOUNDATION', + self::FINE_TUNED => 'FINE_TUNED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CustomModelType::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_GenAiModelInfo_CustomGenAiModelInfo_CustomModelType::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php new file mode 100644 index 000000000000..52e91021b187 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php @@ -0,0 +1,108 @@ +google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + */ +class FoundationGenAiModelInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Whether finetuning is allowed for this base processor version. + * + * Generated from protobuf field bool finetuning_allowed = 1; + */ + protected $finetuning_allowed = false; + /** + * The minimum number of labeled documents in the training dataset + * required for finetuning. + * + * Generated from protobuf field int32 min_train_labeled_documents = 2; + */ + protected $min_train_labeled_documents = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $finetuning_allowed + * Whether finetuning is allowed for this base processor version. + * @type int $min_train_labeled_documents + * The minimum number of labeled documents in the training dataset + * required for finetuning. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); + parent::__construct($data); + } + + /** + * Whether finetuning is allowed for this base processor version. + * + * Generated from protobuf field bool finetuning_allowed = 1; + * @return bool + */ + public function getFinetuningAllowed() + { + return $this->finetuning_allowed; + } + + /** + * Whether finetuning is allowed for this base processor version. + * + * Generated from protobuf field bool finetuning_allowed = 1; + * @param bool $var + * @return $this + */ + public function setFinetuningAllowed($var) + { + GPBUtil::checkBool($var); + $this->finetuning_allowed = $var; + + return $this; + } + + /** + * The minimum number of labeled documents in the training dataset + * required for finetuning. + * + * Generated from protobuf field int32 min_train_labeled_documents = 2; + * @return int + */ + public function getMinTrainLabeledDocuments() + { + return $this->min_train_labeled_documents; + } + + /** + * The minimum number of labeled documents in the training dataset + * required for finetuning. + * + * Generated from protobuf field int32 min_train_labeled_documents = 2; + * @param int $var + * @return $this + */ + public function setMinTrainLabeledDocuments($var) + { + GPBUtil::checkInt32($var); + $this->min_train_labeled_documents = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FoundationGenAiModelInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_GenAiModelInfo_FoundationGenAiModelInfo::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/ModelType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/ModelType.php new file mode 100644 index 000000000000..01dae38d59e2 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/ModelType.php @@ -0,0 +1,64 @@ +google.cloud.documentai.v1.ProcessorVersion.ModelType + */ +class ModelType +{ + /** + * The processor version has unspecified model type. + * + * Generated from protobuf enum MODEL_TYPE_UNSPECIFIED = 0; + */ + const MODEL_TYPE_UNSPECIFIED = 0; + /** + * The processor version has generative model type. + * + * Generated from protobuf enum MODEL_TYPE_GENERATIVE = 1; + */ + const MODEL_TYPE_GENERATIVE = 1; + /** + * The processor version has custom model type. + * + * Generated from protobuf enum MODEL_TYPE_CUSTOM = 2; + */ + const MODEL_TYPE_CUSTOM = 2; + + private static $valueToName = [ + self::MODEL_TYPE_UNSPECIFIED => 'MODEL_TYPE_UNSPECIFIED', + self::MODEL_TYPE_GENERATIVE => 'MODEL_TYPE_GENERATIVE', + self::MODEL_TYPE_CUSTOM => 'MODEL_TYPE_CUSTOM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ModelType::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_ModelType::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/State.php new file mode 100644 index 000000000000..3c740d1f1bb4 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/State.php @@ -0,0 +1,106 @@ +google.cloud.documentai.v1.ProcessorVersion.State + */ +class State +{ + /** + * The processor version is in an unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The processor version is deployed and can be used for processing. + * + * Generated from protobuf enum DEPLOYED = 1; + */ + const DEPLOYED = 1; + /** + * The processor version is being deployed. + * + * Generated from protobuf enum DEPLOYING = 2; + */ + const DEPLOYING = 2; + /** + * The processor version is not deployed and cannot be used for processing. + * + * Generated from protobuf enum UNDEPLOYED = 3; + */ + const UNDEPLOYED = 3; + /** + * The processor version is being undeployed. + * + * Generated from protobuf enum UNDEPLOYING = 4; + */ + const UNDEPLOYING = 4; + /** + * The processor version is being created. + * + * Generated from protobuf enum CREATING = 5; + */ + const CREATING = 5; + /** + * The processor version is being deleted. + * + * Generated from protobuf enum DELETING = 6; + */ + const DELETING = 6; + /** + * The processor version failed and is in an indeterminate state. + * + * Generated from protobuf enum FAILED = 7; + */ + const FAILED = 7; + /** + * The processor version is being imported. + * + * Generated from protobuf enum IMPORTING = 8; + */ + const IMPORTING = 8; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::DEPLOYED => 'DEPLOYED', + self::DEPLOYING => 'DEPLOYING', + self::UNDEPLOYED => 'UNDEPLOYED', + self::UNDEPLOYING => 'UNDEPLOYING', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::IMPORTING => 'IMPORTING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_State::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersionAlias.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersionAlias.php new file mode 100644 index 000000000000..704c750728bf --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersionAlias.php @@ -0,0 +1,101 @@ +google.cloud.documentai.v1.ProcessorVersionAlias + */ +class ProcessorVersionAlias extends \Google\Protobuf\Internal\Message +{ + /** + * The alias in the form of `processor_version` resource name. + * + * Generated from protobuf field string alias = 1; + */ + protected $alias = ''; + /** + * The resource name of aliased processor version. + * + * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { + */ + protected $processor_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $alias + * The alias in the form of `processor_version` resource name. + * @type string $processor_version + * The resource name of aliased processor version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); + parent::__construct($data); + } + + /** + * The alias in the form of `processor_version` resource name. + * + * Generated from protobuf field string alias = 1; + * @return string + */ + public function getAlias() + { + return $this->alias; + } + + /** + * The alias in the form of `processor_version` resource name. + * + * Generated from protobuf field string alias = 1; + * @param string $var + * @return $this + */ + public function setAlias($var) + { + GPBUtil::checkString($var, True); + $this->alias = $var; + + return $this; + } + + /** + * The resource name of aliased processor version. + * + * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getProcessorVersion() + { + return $this->processor_version; + } + + /** + * The resource name of aliased processor version. + * + * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProcessorVersion($var) + { + GPBUtil::checkString($var, True); + $this->processor_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/RawDocument.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/RawDocument.php new file mode 100644 index 000000000000..efe1134b293f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/RawDocument.php @@ -0,0 +1,155 @@ +google.cloud.documentai.v1.RawDocument + */ +class RawDocument extends \Google\Protobuf\Internal\Message +{ + /** + * Inline document content. + * + * Generated from protobuf field bytes content = 1; + */ + protected $content = ''; + /** + * An IANA MIME type (RFC6838) indicating the nature and format of the + * [content][google.cloud.documentai.v1.RawDocument.content]. + * + * Generated from protobuf field string mime_type = 2; + */ + protected $mime_type = ''; + /** + * The display name of the document, it supports all Unicode characters except + * the following: + * `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` + * `~`, `=` and `:` are reserved. + * If not specified, a default ID is generated. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Inline document content. + * @type string $mime_type + * An IANA MIME type (RFC6838) indicating the nature and format of the + * [content][google.cloud.documentai.v1.RawDocument.content]. + * @type string $display_name + * The display name of the document, it supports all Unicode characters except + * the following: + * `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` + * `~`, `=` and `:` are reserved. + * If not specified, a default ID is generated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); + parent::__construct($data); + } + + /** + * Inline document content. + * + * Generated from protobuf field bytes content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Inline document content. + * + * Generated from protobuf field bytes content = 1; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, False); + $this->content = $var; + + return $this; + } + + /** + * An IANA MIME type (RFC6838) indicating the nature and format of the + * [content][google.cloud.documentai.v1.RawDocument.content]. + * + * Generated from protobuf field string mime_type = 2; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * An IANA MIME type (RFC6838) indicating the nature and format of the + * [content][google.cloud.documentai.v1.RawDocument.content]. + * + * Generated from protobuf field string mime_type = 2; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * The display name of the document, it supports all Unicode characters except + * the following: + * `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` + * `~`, `=` and `:` are reserved. + * If not specified, a default ID is generated. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the document, it supports all Unicode characters except + * the following: + * `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` + * `~`, `=` and `:` are reserved. + * If not specified, a default ID is generated. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentOperationMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentOperationMetadata.php new file mode 100644 index 000000000000..e367e4513d12 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentOperationMetadata.php @@ -0,0 +1,113 @@ +google.cloud.documentai.v1.ReviewDocumentOperationMetadata + */ +class ReviewDocumentOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + */ + protected $common_metadata = null; + /** + * The Crowd Compute question ID. + * + * Generated from protobuf field string question_id = 6; + */ + protected $question_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * @type string $question_id + * The Crowd Compute question ID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + + /** + * The Crowd Compute question ID. + * + * Generated from protobuf field string question_id = 6; + * @return string + */ + public function getQuestionId() + { + return $this->question_id; + } + + /** + * The Crowd Compute question ID. + * + * Generated from protobuf field string question_id = 6; + * @param string $var + * @return $this + */ + public function setQuestionId($var) + { + GPBUtil::checkString($var, True); + $this->question_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest.php new file mode 100644 index 000000000000..9e4a1bf7c987 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest.php @@ -0,0 +1,247 @@ +google.cloud.documentai.v1.ReviewDocumentRequest + */ +class ReviewDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. + * + * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $human_review_config = ''; + /** + * Whether the validation should be performed on the ad-hoc review request. + * + * Generated from protobuf field bool enable_schema_validation = 3; + */ + protected $enable_schema_validation = false; + /** + * The priority of the human review task. + * + * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentRequest.Priority priority = 5; + */ + protected $priority = 0; + /** + * The document schema of the human review task. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + */ + protected $document_schema = null; + protected $source; + + /** + * @param string $humanReviewConfig Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. Please see + * {@see DocumentProcessorServiceClient::humanReviewConfigName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest + * + * @experimental + */ + public static function build(string $humanReviewConfig): self + { + return (new self()) + ->setHumanReviewConfig($humanReviewConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\Document $inline_document + * An inline document proto. + * @type string $human_review_config + * Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. + * @type bool $enable_schema_validation + * Whether the validation should be performed on the ad-hoc review request. + * @type int $priority + * The priority of the human review task. + * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $document_schema + * The document schema of the human review task. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * An inline document proto. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document inline_document = 4; + * @return \Google\Cloud\DocumentAI\V1\Document|null + */ + public function getInlineDocument() + { + return $this->readOneof(4); + } + + public function hasInlineDocument() + { + return $this->hasOneof(4); + } + + /** + * An inline document proto. + * + * Generated from protobuf field .google.cloud.documentai.v1.Document inline_document = 4; + * @param \Google\Cloud\DocumentAI\V1\Document $var + * @return $this + */ + public function setInlineDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. + * + * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getHumanReviewConfig() + { + return $this->human_review_config; + } + + /** + * Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. + * + * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setHumanReviewConfig($var) + { + GPBUtil::checkString($var, True); + $this->human_review_config = $var; + + return $this; + } + + /** + * Whether the validation should be performed on the ad-hoc review request. + * + * Generated from protobuf field bool enable_schema_validation = 3; + * @return bool + */ + public function getEnableSchemaValidation() + { + return $this->enable_schema_validation; + } + + /** + * Whether the validation should be performed on the ad-hoc review request. + * + * Generated from protobuf field bool enable_schema_validation = 3; + * @param bool $var + * @return $this + */ + public function setEnableSchemaValidation($var) + { + GPBUtil::checkBool($var); + $this->enable_schema_validation = $var; + + return $this; + } + + /** + * The priority of the human review task. + * + * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentRequest.Priority priority = 5; + * @return int + */ + public function getPriority() + { + return $this->priority; + } + + /** + * The priority of the human review task. + * + * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentRequest.Priority priority = 5; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest\Priority::class); + $this->priority = $var; + + return $this; + } + + /** + * The document schema of the human review task. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null + */ + public function getDocumentSchema() + { + return $this->document_schema; + } + + public function hasDocumentSchema() + { + return isset($this->document_schema); + } + + public function clearDocumentSchema() + { + unset($this->document_schema); + } + + /** + * The document schema of the human review task. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 6; + * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var + * @return $this + */ + public function setDocumentSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema::class); + $this->document_schema = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest/Priority.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest/Priority.php new file mode 100644 index 000000000000..41929b863a9d --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest/Priority.php @@ -0,0 +1,62 @@ +google.cloud.documentai.v1.ReviewDocumentRequest.Priority + */ +class Priority +{ + /** + * The default priority level. + * + * Generated from protobuf enum DEFAULT = 0; + */ + const PBDEFAULT = 0; + /** + * The urgent priority level. The labeling manager should allocate labeler + * resource to the urgent task queue to respect this priority level. + * + * Generated from protobuf enum URGENT = 1; + */ + const URGENT = 1; + + private static $valueToName = [ + self::PBDEFAULT => 'DEFAULT', + self::URGENT => 'URGENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Priority::class, \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest_Priority::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse.php new file mode 100644 index 000000000000..660f9271b9a6 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse.php @@ -0,0 +1,141 @@ +google.cloud.documentai.v1.ReviewDocumentResponse + */ +class ReviewDocumentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The Cloud Storage uri for the human reviewed document if the review is + * succeeded. + * + * Generated from protobuf field string gcs_destination = 1; + */ + protected $gcs_destination = ''; + /** + * The state of the review operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + */ + protected $state = 0; + /** + * The reason why the review is rejected by reviewer. + * + * Generated from protobuf field string rejection_reason = 3; + */ + protected $rejection_reason = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_destination + * The Cloud Storage uri for the human reviewed document if the review is + * succeeded. + * @type int $state + * The state of the review operation. + * @type string $rejection_reason + * The reason why the review is rejected by reviewer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage uri for the human reviewed document if the review is + * succeeded. + * + * Generated from protobuf field string gcs_destination = 1; + * @return string + */ + public function getGcsDestination() + { + return $this->gcs_destination; + } + + /** + * The Cloud Storage uri for the human reviewed document if the review is + * succeeded. + * + * Generated from protobuf field string gcs_destination = 1; + * @param string $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkString($var, True); + $this->gcs_destination = $var; + + return $this; + } + + /** + * The state of the review operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the review operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ReviewDocumentResponse\State::class); + $this->state = $var; + + return $this; + } + + /** + * The reason why the review is rejected by reviewer. + * + * Generated from protobuf field string rejection_reason = 3; + * @return string + */ + public function getRejectionReason() + { + return $this->rejection_reason; + } + + /** + * The reason why the review is rejected by reviewer. + * + * Generated from protobuf field string rejection_reason = 3; + * @param string $var + * @return $this + */ + public function setRejectionReason($var) + { + GPBUtil::checkString($var, True); + $this->rejection_reason = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse/State.php new file mode 100644 index 000000000000..89dda0791451 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse/State.php @@ -0,0 +1,64 @@ +google.cloud.documentai.v1.ReviewDocumentResponse.State + */ +class State +{ + /** + * The default value. This value is used if the state is omitted. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The review operation is rejected by the reviewer. + * + * Generated from protobuf enum REJECTED = 1; + */ + const REJECTED = 1; + /** + * The review operation is succeeded. + * + * Generated from protobuf enum SUCCEEDED = 2; + */ + const SUCCEEDED = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::REJECTED => 'REJECTED', + self::SUCCEEDED => 'SUCCEEDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\DocumentAI\V1\ReviewDocumentResponse_State::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionMetadata.php new file mode 100644 index 000000000000..6830b29e2510 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionMetadata.php @@ -0,0 +1,79 @@ +google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + */ +class SetDefaultProcessorVersionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + protected $common_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionRequest.php new file mode 100644 index 000000000000..3ec67a74150a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionRequest.php @@ -0,0 +1,123 @@ +google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + */ +class SetDefaultProcessorVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. + * + * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $processor = ''; + /** + * Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + * + * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $default_processor_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $processor + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. + * @type string $default_processor_version + * Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. + * + * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getProcessor() + { + return $this->processor; + } + + /** + * Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. + * + * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProcessor($var) + { + GPBUtil::checkString($var, True); + $this->processor = $var; + + return $this; + } + + /** + * Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + * + * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDefaultProcessorVersion() + { + return $this->default_processor_version; + } + + /** + * Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + * + * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDefaultProcessorVersion($var) + { + GPBUtil::checkString($var, True); + $this->default_processor_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionResponse.php new file mode 100644 index 000000000000..99dada608c4d --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionResponse.php @@ -0,0 +1,35 @@ +google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + */ +class SetDefaultProcessorVersionResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata.php new file mode 100644 index 000000000000..b7ef781099da --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata.php @@ -0,0 +1,165 @@ +google.cloud.documentai.v1.TrainProcessorVersionMetadata + */ +class TrainProcessorVersionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + protected $common_metadata = null; + /** + * The training dataset validation information. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + */ + protected $training_dataset_validation = null; + /** + * The test dataset validation information. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + */ + protected $test_dataset_validation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation $training_dataset_validation + * The training dataset validation information. + * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation $test_dataset_validation + * The test dataset validation information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + + /** + * The training dataset validation information. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation|null + */ + public function getTrainingDatasetValidation() + { + return $this->training_dataset_validation; + } + + public function hasTrainingDatasetValidation() + { + return isset($this->training_dataset_validation); + } + + public function clearTrainingDatasetValidation() + { + unset($this->training_dataset_validation); + } + + /** + * The training dataset validation information. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; + * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation $var + * @return $this + */ + public function setTrainingDatasetValidation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation::class); + $this->training_dataset_validation = $var; + + return $this; + } + + /** + * The test dataset validation information. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation|null + */ + public function getTestDatasetValidation() + { + return $this->test_dataset_validation; + } + + public function hasTestDatasetValidation() + { + return isset($this->test_dataset_validation); + } + + public function clearTestDatasetValidation() + { + unset($this->test_dataset_validation); + } + + /** + * The test dataset validation information. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; + * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation $var + * @return $this + */ + public function setTestDatasetValidation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation::class); + $this->test_dataset_validation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata/DatasetValidation.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata/DatasetValidation.php new file mode 100644 index 000000000000..c30b51c24dfe --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata/DatasetValidation.php @@ -0,0 +1,189 @@ +google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + */ +class DatasetValidation extends \Google\Protobuf\Internal\Message +{ + /** + * The total number of document errors. + * + * Generated from protobuf field int32 document_error_count = 3; + */ + protected $document_error_count = 0; + /** + * The total number of dataset errors. + * + * Generated from protobuf field int32 dataset_error_count = 4; + */ + protected $dataset_error_count = 0; + /** + * Error information pertaining to specific documents. A maximum of 10 + * document errors will be returned. + * Any document with errors will not be used throughout training. + * + * Generated from protobuf field repeated .google.rpc.Status document_errors = 1; + */ + private $document_errors; + /** + * Error information for the dataset as a whole. A maximum of 10 dataset + * errors will be returned. + * A single dataset error is terminal for training. + * + * Generated from protobuf field repeated .google.rpc.Status dataset_errors = 2; + */ + private $dataset_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $document_error_count + * The total number of document errors. + * @type int $dataset_error_count + * The total number of dataset errors. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $document_errors + * Error information pertaining to specific documents. A maximum of 10 + * document errors will be returned. + * Any document with errors will not be used throughout training. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $dataset_errors + * Error information for the dataset as a whole. A maximum of 10 dataset + * errors will be returned. + * A single dataset error is terminal for training. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The total number of document errors. + * + * Generated from protobuf field int32 document_error_count = 3; + * @return int + */ + public function getDocumentErrorCount() + { + return $this->document_error_count; + } + + /** + * The total number of document errors. + * + * Generated from protobuf field int32 document_error_count = 3; + * @param int $var + * @return $this + */ + public function setDocumentErrorCount($var) + { + GPBUtil::checkInt32($var); + $this->document_error_count = $var; + + return $this; + } + + /** + * The total number of dataset errors. + * + * Generated from protobuf field int32 dataset_error_count = 4; + * @return int + */ + public function getDatasetErrorCount() + { + return $this->dataset_error_count; + } + + /** + * The total number of dataset errors. + * + * Generated from protobuf field int32 dataset_error_count = 4; + * @param int $var + * @return $this + */ + public function setDatasetErrorCount($var) + { + GPBUtil::checkInt32($var); + $this->dataset_error_count = $var; + + return $this; + } + + /** + * Error information pertaining to specific documents. A maximum of 10 + * document errors will be returned. + * Any document with errors will not be used throughout training. + * + * Generated from protobuf field repeated .google.rpc.Status document_errors = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDocumentErrors() + { + return $this->document_errors; + } + + /** + * Error information pertaining to specific documents. A maximum of 10 + * document errors will be returned. + * Any document with errors will not be used throughout training. + * + * Generated from protobuf field repeated .google.rpc.Status document_errors = 1; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocumentErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->document_errors = $arr; + + return $this; + } + + /** + * Error information for the dataset as a whole. A maximum of 10 dataset + * errors will be returned. + * A single dataset error is terminal for training. + * + * Generated from protobuf field repeated .google.rpc.Status dataset_errors = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatasetErrors() + { + return $this->dataset_errors; + } + + /** + * Error information for the dataset as a whole. A maximum of 10 dataset + * errors will be returned. + * A single dataset error is terminal for training. + * + * Generated from protobuf field repeated .google.rpc.Status dataset_errors = 2; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatasetErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->dataset_errors = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatasetValidation::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata_DatasetValidation::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest.php new file mode 100644 index 000000000000..c718cdbac2a7 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest.php @@ -0,0 +1,348 @@ +google.cloud.documentai.v1.TrainProcessorVersionRequest + */ +class TrainProcessorVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The processor version to be created. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $processor_version = null; + /** + * Optional. The schema the processor version will be trained with. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $document_schema = null; + /** + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $input_data = null; + /** + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + * + * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $base_processor_version = ''; + protected $processor_flags; + + /** + * @param string $parent Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. Please see + * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. + * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion $processorVersion Required. The processor version to be created. + * + * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DocumentAI\V1\ProcessorVersion $processorVersion): self + { + return (new self()) + ->setParent($parent) + ->setProcessorVersion($processorVersion); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions $custom_document_extraction_options + * Options to control Custom Document Extraction (CDE) Processor. + * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions $foundation_model_tuning_options + * Options to control foundation model tuning of a processor. + * @type string $parent + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion $processor_version + * Required. The processor version to be created. + * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $document_schema + * Optional. The schema the processor version will be trained with. + * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData $input_data + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * @type string $base_processor_version + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Options to control Custom Document Extraction (CDE) Processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions custom_document_extraction_options = 5; + * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions|null + */ + public function getCustomDocumentExtractionOptions() + { + return $this->readOneof(5); + } + + public function hasCustomDocumentExtractionOptions() + { + return $this->hasOneof(5); + } + + /** + * Options to control Custom Document Extraction (CDE) Processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions custom_document_extraction_options = 5; + * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions $var + * @return $this + */ + public function setCustomDocumentExtractionOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Options to control foundation model tuning of a processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions foundation_model_tuning_options = 12; + * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions|null + */ + public function getFoundationModelTuningOptions() + { + return $this->readOneof(12); + } + + public function hasFoundationModelTuningOptions() + { + return $this->hasOneof(12); + } + + /** + * Options to control foundation model tuning of a processor. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions foundation_model_tuning_options = 12; + * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions $var + * @return $this + */ + public function setFoundationModelTuningOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The processor version to be created. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion|null + */ + public function getProcessorVersion() + { + return $this->processor_version; + } + + public function hasProcessorVersion() + { + return isset($this->processor_version); + } + + public function clearProcessorVersion() + { + unset($this->processor_version); + } + + /** + * Required. The processor version to be created. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion $var + * @return $this + */ + public function setProcessorVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion::class); + $this->processor_version = $var; + + return $this; + } + + /** + * Optional. The schema the processor version will be trained with. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null + */ + public function getDocumentSchema() + { + return $this->document_schema; + } + + public function hasDocumentSchema() + { + return isset($this->document_schema); + } + + public function clearDocumentSchema() + { + unset($this->document_schema); + } + + /** + * Optional. The schema the processor version will be trained with. + * + * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var + * @return $this + */ + public function setDocumentSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema::class); + $this->document_schema = $var; + + return $this; + } + + /** + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData|null + */ + public function getInputData() + { + return $this->input_data; + } + + public function hasInputData() + { + return isset($this->input_data); + } + + public function clearInputData() + { + unset($this->input_data); + } + + /** + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData $var + * @return $this + */ + public function setInputData($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData::class); + $this->input_data = $var; + + return $this; + } + + /** + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + * + * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBaseProcessorVersion() + { + return $this->base_processor_version; + } + + /** + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + * + * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBaseProcessorVersion($var) + { + GPBUtil::checkString($var, True); + $this->base_processor_version = $var; + + return $this; + } + + /** + * @return string + */ + public function getProcessorFlags() + { + return $this->whichOneof("processor_flags"); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php new file mode 100644 index 000000000000..d3323c332634 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php @@ -0,0 +1,71 @@ +google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + */ +class CustomDocumentExtractionOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Training method to use for CDE training. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; + */ + protected $training_method = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $training_method + * Training method to use for CDE training. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Training method to use for CDE training. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; + * @return int + */ + public function getTrainingMethod() + { + return $this->training_method; + } + + /** + * Training method to use for CDE training. + * + * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; + * @param int $var + * @return $this + */ + public function setTrainingMethod($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions\TrainingMethod::class); + $this->training_method = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CustomDocumentExtractionOptions::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest_CustomDocumentExtractionOptions::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php new file mode 100644 index 000000000000..67f7b58ff0e9 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php @@ -0,0 +1,59 @@ +google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod + */ +class TrainingMethod +{ + /** + * Generated from protobuf enum TRAINING_METHOD_UNSPECIFIED = 0; + */ + const TRAINING_METHOD_UNSPECIFIED = 0; + /** + * Generated from protobuf enum MODEL_BASED = 1; + */ + const MODEL_BASED = 1; + /** + * Generated from protobuf enum TEMPLATE_BASED = 2; + */ + const TEMPLATE_BASED = 2; + + private static $valueToName = [ + self::TRAINING_METHOD_UNSPECIFIED => 'TRAINING_METHOD_UNSPECIFIED', + self::MODEL_BASED => 'MODEL_BASED', + self::TEMPLATE_BASED => 'TEMPLATE_BASED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TrainingMethod::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest_CustomDocumentExtractionOptions_TrainingMethod::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php new file mode 100644 index 000000000000..ff45cadfee71 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php @@ -0,0 +1,116 @@ +google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + */ +class FoundationModelTuningOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The number of steps to run for model tuning. Valid values are + * between 1 and 400. If not provided, recommended steps will be used. + * + * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $train_steps = 0; + /** + * Optional. The multiplier to apply to the recommended learning rate. Valid + * values are between 0.1 and 10. If not provided, recommended learning rate + * will be used. + * + * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $learning_rate_multiplier = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $train_steps + * Optional. The number of steps to run for model tuning. Valid values are + * between 1 and 400. If not provided, recommended steps will be used. + * @type float $learning_rate_multiplier + * Optional. The multiplier to apply to the recommended learning rate. Valid + * values are between 0.1 and 10. If not provided, recommended learning rate + * will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The number of steps to run for model tuning. Valid values are + * between 1 and 400. If not provided, recommended steps will be used. + * + * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTrainSteps() + { + return $this->train_steps; + } + + /** + * Optional. The number of steps to run for model tuning. Valid values are + * between 1 and 400. If not provided, recommended steps will be used. + * + * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTrainSteps($var) + { + GPBUtil::checkInt32($var); + $this->train_steps = $var; + + return $this; + } + + /** + * Optional. The multiplier to apply to the recommended learning rate. Valid + * values are between 0.1 and 10. If not provided, recommended learning rate + * will be used. + * + * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getLearningRateMultiplier() + { + return $this->learning_rate_multiplier; + } + + /** + * Optional. The multiplier to apply to the recommended learning rate. Valid + * values are between 0.1 and 10. If not provided, recommended learning rate + * will be used. + * + * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setLearningRateMultiplier($var) + { + GPBUtil::checkFloat($var); + $this->learning_rate_multiplier = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FoundationModelTuningOptions::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest_FoundationModelTuningOptions::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/InputData.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/InputData.php new file mode 100644 index 000000000000..c1a4db267951 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/InputData.php @@ -0,0 +1,125 @@ +google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + */ +class InputData extends \Google\Protobuf\Internal\Message +{ + /** + * The documents used for training the new version. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + */ + protected $training_documents = null; + /** + * The documents used for testing the trained version. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + */ + protected $test_documents = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $training_documents + * The documents used for training the new version. + * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $test_documents + * The documents used for testing the trained version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The documents used for training the new version. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null + */ + public function getTrainingDocuments() + { + return $this->training_documents; + } + + public function hasTrainingDocuments() + { + return isset($this->training_documents); + } + + public function clearTrainingDocuments() + { + unset($this->training_documents); + } + + /** + * The documents used for training the new version. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; + * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var + * @return $this + */ + public function setTrainingDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig::class); + $this->training_documents = $var; + + return $this; + } + + /** + * The documents used for testing the trained version. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null + */ + public function getTestDocuments() + { + return $this->test_documents; + } + + public function hasTestDocuments() + { + return isset($this->test_documents); + } + + public function clearTestDocuments() + { + unset($this->test_documents); + } + + /** + * The documents used for testing the trained version. + * + * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; + * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var + * @return $this + */ + public function setTestDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig::class); + $this->test_documents = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InputData::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest_InputData::class); + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionResponse.php new file mode 100644 index 000000000000..c46c6b822b85 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionResponse.php @@ -0,0 +1,68 @@ +google.cloud.documentai.v1.TrainProcessorVersionResponse + */ +class TrainProcessorVersionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the processor version produced by training. + * + * Generated from protobuf field string processor_version = 1; + */ + protected $processor_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $processor_version + * The resource name of the processor version produced by training. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the processor version produced by training. + * + * Generated from protobuf field string processor_version = 1; + * @return string + */ + public function getProcessorVersion() + { + return $this->processor_version; + } + + /** + * The resource name of the processor version produced by training. + * + * Generated from protobuf field string processor_version = 1; + * @param string $var + * @return $this + */ + public function setProcessorVersion($var) + { + GPBUtil::checkString($var, True); + $this->processor_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionMetadata.php new file mode 100644 index 000000000000..7b046ed6c93b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionMetadata.php @@ -0,0 +1,79 @@ +google.cloud.documentai.v1.UndeployProcessorVersionMetadata + */ +class UndeployProcessorVersionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + */ + protected $common_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata + * The basic metadata of the long-running operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null + */ + public function getCommonMetadata() + { + return $this->common_metadata; + } + + public function hasCommonMetadata() + { + return isset($this->common_metadata); + } + + public function clearCommonMetadata() + { + unset($this->common_metadata); + } + + /** + * The basic metadata of the long-running operation. + * + * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; + * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var + * @return $this + */ + public function setCommonMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); + $this->common_metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionRequest.php new file mode 100644 index 000000000000..1c5cb20ed5f8 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionRequest.php @@ -0,0 +1,83 @@ +google.cloud.documentai.v1.UndeployProcessorVersionRequest + */ +class UndeployProcessorVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The processor version resource name to be undeployed. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The processor version resource name to be undeployed. Please see + * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. + * + * @return \Google\Cloud\DocumentAI\V1\UndeployProcessorVersionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The processor version resource name to be undeployed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The processor version resource name to be undeployed. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The processor version resource name to be undeployed. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionResponse.php new file mode 100644 index 000000000000..e6d592d8b55a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionResponse.php @@ -0,0 +1,35 @@ +google.cloud.documentai.v1.UndeployProcessorVersionResponse + */ +class UndeployProcessorVersionResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Vertex.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Vertex.php new file mode 100644 index 000000000000..d56818347c95 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Vertex.php @@ -0,0 +1,102 @@ +google.cloud.documentai.v1.Vertex + */ +class Vertex extends \Google\Protobuf\Internal\Message +{ + /** + * X coordinate. + * + * Generated from protobuf field int32 x = 1; + */ + protected $x = 0; + /** + * Y coordinate (starts from the top of the image). + * + * Generated from protobuf field int32 y = 2; + */ + protected $y = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $x + * X coordinate. + * @type int $y + * Y coordinate (starts from the top of the image). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Documentai\V1\Geometry::initOnce(); + parent::__construct($data); + } + + /** + * X coordinate. + * + * Generated from protobuf field int32 x = 1; + * @return int + */ + public function getX() + { + return $this->x; + } + + /** + * X coordinate. + * + * Generated from protobuf field int32 x = 1; + * @param int $var + * @return $this + */ + public function setX($var) + { + GPBUtil::checkInt32($var); + $this->x = $var; + + return $this; + } + + /** + * Y coordinate (starts from the top of the image). + * + * Generated from protobuf field int32 y = 2; + * @return int + */ + public function getY() + { + return $this->y; + } + + /** + * Y coordinate (starts from the top of the image). + * + * Generated from protobuf field int32 y = 2; + * @param int $var + * @return $this + */ + public function setY($var) + { + GPBUtil::checkInt32($var); + $this->y = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php new file mode 100644 index 000000000000..5c92935d071b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php @@ -0,0 +1,88 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->batchProcessDocuments($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchProcessResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + batch_process_documents_sample($name); +} +// [END documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/create_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/create_processor.php new file mode 100644 index 000000000000..cd7f845f943a --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/create_processor.php @@ -0,0 +1,80 @@ +setParent($formattedParent) + ->setProcessor($processor); + + // Call the API and handle any network failures. + try { + /** @var Processor $response */ + $response = $documentProcessorServiceClient->createProcessor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentProcessorServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_processor_sample($formattedParent); +} +// [END documentai_v1_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor.php new file mode 100644 index 000000000000..627fab2af8e1 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->deleteProcessor($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]' + ); + + delete_processor_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor_version.php new file mode 100644 index 000000000000..5ed8b9048b8f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor_version.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->deleteProcessorVersion($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorVersionName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]', + '[PROCESSOR_VERSION]' + ); + + delete_processor_version_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php new file mode 100644 index 000000000000..28e1d7e8061c --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php @@ -0,0 +1,88 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->deployProcessorVersion($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DeployProcessorVersionResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorVersionName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]', + '[PROCESSOR_VERSION]' + ); + + deploy_processor_version_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/disable_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/disable_processor.php new file mode 100644 index 000000000000..60db2b4dc9af --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/disable_processor.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->disableProcessor($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DisableProcessorResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]' + ); + + disable_processor_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/enable_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/enable_processor.php new file mode 100644 index 000000000000..2ec7bdda6851 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/enable_processor.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->enableProcessor($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var EnableProcessorResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]' + ); + + enable_processor_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php new file mode 100644 index 000000000000..90b907983c0f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php @@ -0,0 +1,92 @@ +setProcessorVersion($formattedProcessorVersion); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->evaluateProcessorVersion($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var EvaluateProcessorVersionResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProcessorVersion = DocumentProcessorServiceClient::processorVersionName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]', + '[PROCESSOR_VERSION]' + ); + + evaluate_processor_version_sample($formattedProcessorVersion); +} +// [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php new file mode 100644 index 000000000000..7be2f8f45b7b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php @@ -0,0 +1,74 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var FetchProcessorTypesResponse $response */ + $response = $documentProcessorServiceClient->fetchProcessorTypes($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentProcessorServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + fetch_processor_types_sample($formattedParent); +} +// [END documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_evaluation.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_evaluation.php new file mode 100644 index 000000000000..5173e6f5eacf --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_evaluation.php @@ -0,0 +1,79 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Evaluation $response */ + $response = $documentProcessorServiceClient->getEvaluation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::evaluationName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]', + '[PROCESSOR_VERSION]', + '[EVALUATION]' + ); + + get_evaluation_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_location.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_location.php new file mode 100644 index 000000000000..9d52a912d85b --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END documentai_v1_generated_DocumentProcessorService_GetLocation_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor.php new file mode 100644 index 000000000000..a6886cfe7001 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Processor $response */ + $response = $documentProcessorServiceClient->getProcessor($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]' + ); + + get_processor_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_type.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_type.php new file mode 100644 index 000000000000..b734a91e4795 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_type.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ProcessorType $response */ + $response = $documentProcessorServiceClient->getProcessorType($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorTypeName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR_TYPE]' + ); + + get_processor_type_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_GetProcessorType_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_version.php new file mode 100644 index 000000000000..dc0474ab1064 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_version.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ProcessorVersion $response */ + $response = $documentProcessorServiceClient->getProcessorVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorVersionName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]', + '[PROCESSOR_VERSION]' + ); + + get_processor_version_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_evaluations.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_evaluations.php new file mode 100644 index 000000000000..25c87e832ffb --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_evaluations.php @@ -0,0 +1,84 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $documentProcessorServiceClient->listEvaluations($request); + + /** @var Evaluation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentProcessorServiceClient::processorVersionName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]', + '[PROCESSOR_VERSION]' + ); + + list_evaluations_sample($formattedParent); +} +// [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_locations.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_locations.php new file mode 100644 index 000000000000..5cbfdbbb5f4f --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END documentai_v1_generated_DocumentProcessorService_ListLocations_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_types.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_types.php new file mode 100644 index 000000000000..3882352e5fe6 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_types.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $documentProcessorServiceClient->listProcessorTypes($request); + + /** @var ProcessorType $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentProcessorServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_processor_types_sample($formattedParent); +} +// [END documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php new file mode 100644 index 000000000000..23d07762ebe0 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $documentProcessorServiceClient->listProcessorVersions($request); + + /** @var ProcessorVersion $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentProcessorServiceClient::processorName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]' + ); + + list_processor_versions_sample($formattedParent); +} +// [END documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processors.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processors.php new file mode 100644 index 000000000000..35369a0426d4 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processors.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $documentProcessorServiceClient->listProcessors($request); + + /** @var Processor $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentProcessorServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_processors_sample($formattedParent); +} +// [END documentai_v1_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/process_document.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/process_document.php new file mode 100644 index 000000000000..9491299e8723 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/process_document.php @@ -0,0 +1,79 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var ProcessResponse $response */ + $response = $documentProcessorServiceClient->processDocument($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + process_document_sample($name); +} +// [END documentai_v1_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/review_document.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/review_document.php new file mode 100644 index 000000000000..3ff6e2ef5433 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/review_document.php @@ -0,0 +1,90 @@ +setHumanReviewConfig($formattedHumanReviewConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->reviewDocument($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ReviewDocumentResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedHumanReviewConfig = DocumentProcessorServiceClient::humanReviewConfigName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]' + ); + + review_document_sample($formattedHumanReviewConfig); +} +// [END documentai_v1_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php new file mode 100644 index 000000000000..5221bc4baf85 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php @@ -0,0 +1,107 @@ +setProcessor($formattedProcessor) + ->setDefaultProcessorVersion($formattedDefaultProcessorVersion); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->setDefaultProcessorVersion($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SetDefaultProcessorVersionResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedProcessor = DocumentProcessorServiceClient::processorName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]' + ); + $formattedDefaultProcessorVersion = DocumentProcessorServiceClient::processorVersionName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]', + '[PROCESSOR_VERSION]' + ); + + set_default_processor_version_sample($formattedProcessor, $formattedDefaultProcessorVersion); +} +// [END documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/train_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/train_processor_version.php new file mode 100644 index 000000000000..94059bc29174 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/train_processor_version.php @@ -0,0 +1,94 @@ +setParent($formattedParent) + ->setProcessorVersion($processorVersion); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->trainProcessorVersion($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var TrainProcessorVersionResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DocumentProcessorServiceClient::processorName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]' + ); + + train_processor_version_sample($formattedParent); +} +// [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php new file mode 100644 index 000000000000..ddee2a4812dd --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php @@ -0,0 +1,88 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $documentProcessorServiceClient->undeployProcessorVersion($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var UndeployProcessorVersionResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DocumentProcessorServiceClient::processorVersionName( + '[PROJECT]', + '[LOCATION]', + '[PROCESSOR]', + '[PROCESSOR_VERSION]' + ); + + undeploy_processor_version_sample($formattedName); +} +// [END documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/Client/DocumentProcessorServiceClient.php b/owl-bot-staging/DocumentAi/v1/src/V1/Client/DocumentProcessorServiceClient.php new file mode 100644 index 000000000000..d95b10ee7cdb --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/src/V1/Client/DocumentProcessorServiceClient.php @@ -0,0 +1,1075 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/document_processor_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/document_processor_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/document_processor_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/document_processor_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Formats a string containing the fully-qualified path to represent a evaluation + * resource. + * + * @param string $project + * @param string $location + * @param string $processor + * @param string $processorVersion + * @param string $evaluation + * + * @return string The formatted evaluation resource. + */ + public static function evaluationName(string $project, string $location, string $processor, string $processorVersion, string $evaluation): string + { + return self::getPathTemplate('evaluation')->render([ + 'project' => $project, + 'location' => $location, + 'processor' => $processor, + 'processor_version' => $processorVersion, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * human_review_config resource. + * + * @param string $project + * @param string $location + * @param string $processor + * + * @return string The formatted human_review_config resource. + */ + public static function humanReviewConfigName(string $project, string $location, string $processor): string + { + return self::getPathTemplate('humanReviewConfig')->render([ + 'project' => $project, + 'location' => $location, + 'processor' => $processor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a processor + * resource. + * + * @param string $project + * @param string $location + * @param string $processor + * + * @return string The formatted processor resource. + */ + public static function processorName(string $project, string $location, string $processor): string + { + return self::getPathTemplate('processor')->render([ + 'project' => $project, + 'location' => $location, + 'processor' => $processor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * processor_type resource. + * + * @param string $project + * @param string $location + * @param string $processorType + * + * @return string The formatted processor_type resource. + */ + public static function processorTypeName(string $project, string $location, string $processorType): string + { + return self::getPathTemplate('processorType')->render([ + 'project' => $project, + 'location' => $location, + 'processor_type' => $processorType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * processor_version resource. + * + * @param string $project + * @param string $location + * @param string $processor + * @param string $processorVersion + * + * @return string The formatted processor_version resource. + */ + public static function processorVersionName(string $project, string $location, string $processor, string $processorVersion): string + { + return self::getPathTemplate('processorVersion')->render([ + 'project' => $project, + 'location' => $location, + 'processor' => $processor, + 'processor_version' => $processorVersion, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - evaluation: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation} + * - humanReviewConfig: projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig + * - location: projects/{project}/locations/{location} + * - processor: projects/{project}/locations/{location}/processors/{processor} + * - processorType: projects/{project}/locations/{location}/processorTypes/{processor_type} + * - processorVersion: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'documentai.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * LRO endpoint to batch process many documents. The output is written + * to Cloud Storage as JSON in the [Document] format. + * + * The async variant is + * {@see DocumentProcessorServiceClient::batchProcessDocumentsAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/batch_process_documents.php + * + * @param BatchProcessRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchProcessDocuments(BatchProcessRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchProcessDocuments', $request, $callOptions)->wait(); + } + + /** + * Creates a processor from the + * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + * processor will be at `ENABLED` state by default after its creation. Note + * that this method requires the `documentai.processors.create` permission on + * the project, which is highly privileged. A user or service account with + * this permission can create new processors that can interact with any gcs + * bucket in your project. + * + * The async variant is + * {@see DocumentProcessorServiceClient::createProcessorAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/create_processor.php + * + * @param CreateProcessorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Processor + * + * @throws ApiException Thrown if the API call fails. + */ + public function createProcessor(CreateProcessorRequest $request, array $callOptions = []): Processor + { + return $this->startApiCall('CreateProcessor', $request, $callOptions)->wait(); + } + + /** + * Deletes the processor, unloads all deployed model artifacts if it was + * enabled and then deletes all artifacts associated with this processor. + * + * The async variant is + * {@see DocumentProcessorServiceClient::deleteProcessorAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/delete_processor.php + * + * @param DeleteProcessorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteProcessor(DeleteProcessorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteProcessor', $request, $callOptions)->wait(); + } + + /** + * Deletes the processor version, all artifacts under the processor version + * will be deleted. + * + * The async variant is + * {@see DocumentProcessorServiceClient::deleteProcessorVersionAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/delete_processor_version.php + * + * @param DeleteProcessorVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteProcessorVersion(DeleteProcessorVersionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteProcessorVersion', $request, $callOptions)->wait(); + } + + /** + * Deploys the processor version. + * + * The async variant is + * {@see DocumentProcessorServiceClient::deployProcessorVersionAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php + * + * @param DeployProcessorVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deployProcessorVersion(DeployProcessorVersionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeployProcessorVersion', $request, $callOptions)->wait(); + } + + /** + * Disables a processor + * + * The async variant is + * {@see DocumentProcessorServiceClient::disableProcessorAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/disable_processor.php + * + * @param DisableProcessorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function disableProcessor(DisableProcessorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DisableProcessor', $request, $callOptions)->wait(); + } + + /** + * Enables a processor + * + * The async variant is + * {@see DocumentProcessorServiceClient::enableProcessorAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/enable_processor.php + * + * @param EnableProcessorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function enableProcessor(EnableProcessorRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('EnableProcessor', $request, $callOptions)->wait(); + } + + /** + * Evaluates a ProcessorVersion against annotated documents, producing an + * Evaluation. + * + * The async variant is + * {@see DocumentProcessorServiceClient::evaluateProcessorVersionAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php + * + * @param EvaluateProcessorVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function evaluateProcessorVersion(EvaluateProcessorVersionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('EvaluateProcessorVersion', $request, $callOptions)->wait(); + } + + /** + * Fetches processor types. Note that we don't use + * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + * here, because it isn't paginated. + * + * The async variant is + * {@see DocumentProcessorServiceClient::fetchProcessorTypesAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php + * + * @param FetchProcessorTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FetchProcessorTypesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchProcessorTypes(FetchProcessorTypesRequest $request, array $callOptions = []): FetchProcessorTypesResponse + { + return $this->startApiCall('FetchProcessorTypes', $request, $callOptions)->wait(); + } + + /** + * Retrieves a specific evaluation. + * + * The async variant is {@see DocumentProcessorServiceClient::getEvaluationAsync()} + * . + * + * @example samples/V1/DocumentProcessorServiceClient/get_evaluation.php + * + * @param GetEvaluationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Evaluation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEvaluation(GetEvaluationRequest $request, array $callOptions = []): Evaluation + { + return $this->startApiCall('GetEvaluation', $request, $callOptions)->wait(); + } + + /** + * Gets a processor detail. + * + * The async variant is {@see DocumentProcessorServiceClient::getProcessorAsync()} + * . + * + * @example samples/V1/DocumentProcessorServiceClient/get_processor.php + * + * @param GetProcessorRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Processor + * + * @throws ApiException Thrown if the API call fails. + */ + public function getProcessor(GetProcessorRequest $request, array $callOptions = []): Processor + { + return $this->startApiCall('GetProcessor', $request, $callOptions)->wait(); + } + + /** + * Gets a processor type detail. + * + * The async variant is + * {@see DocumentProcessorServiceClient::getProcessorTypeAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/get_processor_type.php + * + * @param GetProcessorTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProcessorType + * + * @throws ApiException Thrown if the API call fails. + */ + public function getProcessorType(GetProcessorTypeRequest $request, array $callOptions = []): ProcessorType + { + return $this->startApiCall('GetProcessorType', $request, $callOptions)->wait(); + } + + /** + * Gets a processor version detail. + * + * The async variant is + * {@see DocumentProcessorServiceClient::getProcessorVersionAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/get_processor_version.php + * + * @param GetProcessorVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProcessorVersion + * + * @throws ApiException Thrown if the API call fails. + */ + public function getProcessorVersion(GetProcessorVersionRequest $request, array $callOptions = []): ProcessorVersion + { + return $this->startApiCall('GetProcessorVersion', $request, $callOptions)->wait(); + } + + /** + * Retrieves a set of evaluations for a given processor version. + * + * The async variant is + * {@see DocumentProcessorServiceClient::listEvaluationsAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/list_evaluations.php + * + * @param ListEvaluationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEvaluations(ListEvaluationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListEvaluations', $request, $callOptions); + } + + /** + * Lists the processor types that exist. + * + * The async variant is + * {@see DocumentProcessorServiceClient::listProcessorTypesAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/list_processor_types.php + * + * @param ListProcessorTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listProcessorTypes(ListProcessorTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProcessorTypes', $request, $callOptions); + } + + /** + * Lists all versions of a processor. + * + * The async variant is + * {@see DocumentProcessorServiceClient::listProcessorVersionsAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/list_processor_versions.php + * + * @param ListProcessorVersionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listProcessorVersions(ListProcessorVersionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProcessorVersions', $request, $callOptions); + } + + /** + * Lists all processors which belong to this project. + * + * The async variant is + * {@see DocumentProcessorServiceClient::listProcessorsAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/list_processors.php + * + * @param ListProcessorsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listProcessors(ListProcessorsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProcessors', $request, $callOptions); + } + + /** + * Processes a single document. + * + * The async variant is + * {@see DocumentProcessorServiceClient::processDocumentAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/process_document.php + * + * @param ProcessRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProcessResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function processDocument(ProcessRequest $request, array $callOptions = []): ProcessResponse + { + return $this->startApiCall('ProcessDocument', $request, $callOptions)->wait(); + } + + /** + * Send a document for Human Review. The input document should be processed by + * the specified processor. + * + * The async variant is + * {@see DocumentProcessorServiceClient::reviewDocumentAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/review_document.php + * + * @param ReviewDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function reviewDocument(ReviewDocumentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ReviewDocument', $request, $callOptions)->wait(); + } + + /** + * Set the default (active) version of a + * [Processor][google.cloud.documentai.v1.Processor] that will be used in + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + * and + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. + * + * The async variant is + * {@see DocumentProcessorServiceClient::setDefaultProcessorVersionAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php + * + * @param SetDefaultProcessorVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setDefaultProcessorVersion(SetDefaultProcessorVersionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetDefaultProcessorVersion', $request, $callOptions)->wait(); + } + + /** + * Trains a new processor version. + * Operation metadata is returned as + * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. + * + * The async variant is + * {@see DocumentProcessorServiceClient::trainProcessorVersionAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/train_processor_version.php + * + * @param TrainProcessorVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function trainProcessorVersion(TrainProcessorVersionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('TrainProcessorVersion', $request, $callOptions)->wait(); + } + + /** + * Undeploys the processor version. + * + * The async variant is + * {@see DocumentProcessorServiceClient::undeployProcessorVersionAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php + * + * @param UndeployProcessorVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function undeployProcessorVersion(UndeployProcessorVersionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeployProcessorVersion', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DocumentProcessorServiceClient::getLocationAsync()} . + * + * @example samples/V1/DocumentProcessorServiceClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see DocumentProcessorServiceClient::listLocationsAsync()} + * . + * + * @example samples/V1/DocumentProcessorServiceClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/DocumentProcessorServiceClient.php b/owl-bot-staging/DocumentAi/v1/src/V1/DocumentProcessorServiceClient.php new file mode 100644 index 000000000000..db75c66a1ce3 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/src/V1/DocumentProcessorServiceClient.php @@ -0,0 +1,34 @@ +batchProcessDocuments($name); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->batchProcessDocuments($name); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'batchProcessDocuments'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated Please use the new service client {@see \Google\Cloud\DocumentAI\V1\Client\DocumentProcessorServiceClient}. + */ +class DocumentProcessorServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.documentai.v1.DocumentProcessorService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'documentai.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'documentai.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $evaluationNameTemplate; + + private static $humanReviewConfigNameTemplate; + + private static $locationNameTemplate; + + private static $processorNameTemplate; + + private static $processorTypeNameTemplate; + + private static $processorVersionNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/document_processor_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/document_processor_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/document_processor_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/document_processor_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getEvaluationNameTemplate() + { + if (self::$evaluationNameTemplate == null) { + self::$evaluationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}'); + } + + return self::$evaluationNameTemplate; + } + + private static function getHumanReviewConfigNameTemplate() + { + if (self::$humanReviewConfigNameTemplate == null) { + self::$humanReviewConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig'); + } + + return self::$humanReviewConfigNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getProcessorNameTemplate() + { + if (self::$processorNameTemplate == null) { + self::$processorNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processors/{processor}'); + } + + return self::$processorNameTemplate; + } + + private static function getProcessorTypeNameTemplate() + { + if (self::$processorTypeNameTemplate == null) { + self::$processorTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processorTypes/{processor_type}'); + } + + return self::$processorTypeNameTemplate; + } + + private static function getProcessorVersionNameTemplate() + { + if (self::$processorVersionNameTemplate == null) { + self::$processorVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}'); + } + + return self::$processorVersionNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'evaluation' => self::getEvaluationNameTemplate(), + 'humanReviewConfig' => self::getHumanReviewConfigNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'processor' => self::getProcessorNameTemplate(), + 'processorType' => self::getProcessorTypeNameTemplate(), + 'processorVersion' => self::getProcessorVersionNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a evaluation + * resource. + * + * @param string $project + * @param string $location + * @param string $processor + * @param string $processorVersion + * @param string $evaluation + * + * @return string The formatted evaluation resource. + */ + public static function evaluationName($project, $location, $processor, $processorVersion, $evaluation) + { + return self::getEvaluationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'processor' => $processor, + 'processor_version' => $processorVersion, + 'evaluation' => $evaluation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * human_review_config resource. + * + * @param string $project + * @param string $location + * @param string $processor + * + * @return string The formatted human_review_config resource. + */ + public static function humanReviewConfigName($project, $location, $processor) + { + return self::getHumanReviewConfigNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'processor' => $processor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a processor + * resource. + * + * @param string $project + * @param string $location + * @param string $processor + * + * @return string The formatted processor resource. + */ + public static function processorName($project, $location, $processor) + { + return self::getProcessorNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'processor' => $processor, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * processor_type resource. + * + * @param string $project + * @param string $location + * @param string $processorType + * + * @return string The formatted processor_type resource. + */ + public static function processorTypeName($project, $location, $processorType) + { + return self::getProcessorTypeNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'processor_type' => $processorType, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * processor_version resource. + * + * @param string $project + * @param string $location + * @param string $processor + * @param string $processorVersion + * + * @return string The formatted processor_version resource. + */ + public static function processorVersionName($project, $location, $processor, $processorVersion) + { + return self::getProcessorVersionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'processor' => $processor, + 'processor_version' => $processorVersion, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - evaluation: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation} + * - humanReviewConfig: projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig + * - location: projects/{project}/locations/{location} + * - processor: projects/{project}/locations/{location}/processors/{processor} + * - processorType: projects/{project}/locations/{location}/processorTypes/{processor_type} + * - processorVersion: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'documentai.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * LRO endpoint to batch process many documents. The output is written + * to Cloud Storage as JSON in the [Document] format. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $name = 'name'; + * $operationResponse = $documentProcessorServiceClient->batchProcessDocuments($name); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->batchProcessDocuments($name); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'batchProcessDocuments'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param array $optionalArgs { + * Optional. + * + * @type BatchDocumentsInputConfig $inputDocuments + * The input documents for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * @type DocumentOutputConfig $documentOutputConfig + * The output configuration for the + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] + * method. + * @type bool $skipHumanReview + * Whether human review should be skipped for this request. Default to + * `false`. + * @type ProcessOptions $processOptions + * Inference-time options for the process API + * @type array $labels + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function batchProcessDocuments($name, array $optionalArgs = []) + { + $request = new BatchProcessRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['inputDocuments'])) { + $request->setInputDocuments($optionalArgs['inputDocuments']); + } + + if (isset($optionalArgs['documentOutputConfig'])) { + $request->setDocumentOutputConfig($optionalArgs['documentOutputConfig']); + } + + if (isset($optionalArgs['skipHumanReview'])) { + $request->setSkipHumanReview($optionalArgs['skipHumanReview']); + } + + if (isset($optionalArgs['processOptions'])) { + $request->setProcessOptions($optionalArgs['processOptions']); + } + + if (isset($optionalArgs['labels'])) { + $request->setLabels($optionalArgs['labels']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('BatchProcessDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a processor from the + * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The + * processor will be at `ENABLED` state by default after its creation. Note + * that this method requires the `documentai.processors.create` permission on + * the project, which is highly privileged. A user or service account with + * this permission can create new processors that can interact with any gcs + * bucket in your project. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedParent = $documentProcessorServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $processor = new Processor(); + * $response = $documentProcessorServiceClient->createProcessor($formattedParent, $processor); + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * @param Processor $processor Required. The processor to be created, requires + * [Processor.type][google.cloud.documentai.v1.Processor.type] and + * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] + * to be set. Also, the + * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] + * field must be set if the processor is under CMEK. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DocumentAI\V1\Processor + * + * @throws ApiException if the remote call fails + */ + public function createProcessor($parent, $processor, array $optionalArgs = []) + { + $request = new CreateProcessorRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setProcessor($processor); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateProcessor', Processor::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the processor, unloads all deployed model artifacts if it was + * enabled and then deletes all artifacts associated with this processor. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + * $operationResponse = $documentProcessorServiceClient->deleteProcessor($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->deleteProcessor($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'deleteProcessor'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor resource name to be deleted. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteProcessor($name, array $optionalArgs = []) + { + $request = new DeleteProcessorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteProcessor', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes the processor version, all artifacts under the processor version + * will be deleted. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + * $operationResponse = $documentProcessorServiceClient->deleteProcessorVersion($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->deleteProcessorVersion($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'deleteProcessorVersion'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor version resource name to be deleted. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteProcessorVersion($name, array $optionalArgs = []) + { + $request = new DeleteProcessorVersionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deploys the processor version. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + * $operationResponse = $documentProcessorServiceClient->deployProcessorVersion($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->deployProcessorVersion($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'deployProcessorVersion'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor version resource name to be deployed. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deployProcessorVersion($name, array $optionalArgs = []) + { + $request = new DeployProcessorVersionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeployProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Disables a processor + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + * $operationResponse = $documentProcessorServiceClient->disableProcessor($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->disableProcessor($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'disableProcessor'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor resource name to be disabled. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function disableProcessor($name, array $optionalArgs = []) + { + $request = new DisableProcessorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DisableProcessor', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Enables a processor + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + * $operationResponse = $documentProcessorServiceClient->enableProcessor($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->enableProcessor($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'enableProcessor'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor resource name to be enabled. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function enableProcessor($name, array $optionalArgs = []) + { + $request = new EnableProcessorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('EnableProcessor', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Evaluates a ProcessorVersion against annotated documents, producing an + * Evaluation. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedProcessorVersion = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + * $operationResponse = $documentProcessorServiceClient->evaluateProcessorVersion($formattedProcessorVersion); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->evaluateProcessorVersion($formattedProcessorVersion); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'evaluateProcessorVersion'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $processorVersion Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param array $optionalArgs { + * Optional. + * + * @type BatchDocumentsInputConfig $evaluationDocuments + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function evaluateProcessorVersion($processorVersion, array $optionalArgs = []) + { + $request = new EvaluateProcessorVersionRequest(); + $requestParamHeaders = []; + $request->setProcessorVersion($processorVersion); + $requestParamHeaders['processor_version'] = $processorVersion; + if (isset($optionalArgs['evaluationDocuments'])) { + $request->setEvaluationDocuments($optionalArgs['evaluationDocuments']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('EvaluateProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Fetches processor types. Note that we don't use + * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] + * here, because it isn't paginated. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedParent = $documentProcessorServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $response = $documentProcessorServiceClient->fetchProcessorTypes($formattedParent); + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DocumentAI\V1\FetchProcessorTypesResponse + * + * @throws ApiException if the remote call fails + */ + public function fetchProcessorTypes($parent, array $optionalArgs = []) + { + $request = new FetchProcessorTypesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('FetchProcessorTypes', FetchProcessorTypesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a specific evaluation. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); + * $response = $documentProcessorServiceClient->getEvaluation($formattedName); + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DocumentAI\V1\Evaluation + * + * @throws ApiException if the remote call fails + */ + public function getEvaluation($name, array $optionalArgs = []) + { + $request = new GetEvaluationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetEvaluation', Evaluation::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a processor detail. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + * $response = $documentProcessorServiceClient->getProcessor($formattedName); + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor resource name. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DocumentAI\V1\Processor + * + * @throws ApiException if the remote call fails + */ + public function getProcessor($name, array $optionalArgs = []) + { + $request = new GetProcessorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetProcessor', Processor::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a processor type detail. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); + * $response = $documentProcessorServiceClient->getProcessorType($formattedName); + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor type resource name. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DocumentAI\V1\ProcessorType + * + * @throws ApiException if the remote call fails + */ + public function getProcessorType($name, array $optionalArgs = []) + { + $request = new GetProcessorTypeRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetProcessorType', ProcessorType::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a processor version detail. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + * $response = $documentProcessorServiceClient->getProcessorVersion($formattedName); + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor resource name. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion + * + * @throws ApiException if the remote call fails + */ + public function getProcessorVersion($name, array $optionalArgs = []) + { + $request = new GetProcessorVersionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetProcessorVersion', ProcessorVersion::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a set of evaluations for a given processor version. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedParent = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + * // Iterate over pages of elements + * $pagedResponse = $documentProcessorServiceClient->listEvaluations($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $documentProcessorServiceClient->listEvaluations($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listEvaluations($parent, array $optionalArgs = []) + { + $request = new ListEvaluationsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListEvaluations', $optionalArgs, ListEvaluationsResponse::class, $request); + } + + /** + * Lists the processor types that exist. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedParent = $documentProcessorServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $documentProcessorServiceClient->listProcessorTypes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $documentProcessorServiceClient->listProcessorTypes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listProcessorTypes($parent, array $optionalArgs = []) + { + $request = new ListProcessorTypesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListProcessorTypes', $optionalArgs, ListProcessorTypesResponse::class, $request); + } + + /** + * Lists all versions of a processor. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedParent = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + * // Iterate over pages of elements + * $pagedResponse = $documentProcessorServiceClient->listProcessorVersions($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $documentProcessorServiceClient->listProcessorVersions($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listProcessorVersions($parent, array $optionalArgs = []) + { + $request = new ListProcessorVersionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListProcessorVersions', $optionalArgs, ListProcessorVersionsResponse::class, $request); + } + + /** + * Lists all processors which belong to this project. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedParent = $documentProcessorServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $documentProcessorServiceClient->listProcessors($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $documentProcessorServiceClient->listProcessors($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listProcessors($parent, array $optionalArgs = []) + { + $request = new ListProcessorsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListProcessors', $optionalArgs, ListProcessorsResponse::class, $request); + } + + /** + * Processes a single document. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $name = 'name'; + * $response = $documentProcessorServiceClient->processDocument($name); + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] or + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] + * to use for processing. If a + * [Processor][google.cloud.documentai.v1.Processor] is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param array $optionalArgs { + * Optional. + * + * @type Document $inlineDocument + * An inline document proto. + * @type RawDocument $rawDocument + * A raw document content (bytes). + * @type GcsDocument $gcsDocument + * A raw document on Google Cloud Storage. + * @type bool $skipHumanReview + * Whether human review should be skipped for this request. Default to + * `false`. + * @type FieldMask $fieldMask + * Specifies which fields to include in the + * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] + * output. Only supports top-level document and pages field, so it must be in + * the form of `{document_field_name}` or `pages.{page_field_name}`. + * @type ProcessOptions $processOptions + * Inference-time options for the process API + * @type array $labels + * Optional. The labels with user-defined metadata for the request. + * + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * @type bool $imagelessMode + * Optional. Option to remove images from the document. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DocumentAI\V1\ProcessResponse + * + * @throws ApiException if the remote call fails + */ + public function processDocument($name, array $optionalArgs = []) + { + $request = new ProcessRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['inlineDocument'])) { + $request->setInlineDocument($optionalArgs['inlineDocument']); + } + + if (isset($optionalArgs['rawDocument'])) { + $request->setRawDocument($optionalArgs['rawDocument']); + } + + if (isset($optionalArgs['gcsDocument'])) { + $request->setGcsDocument($optionalArgs['gcsDocument']); + } + + if (isset($optionalArgs['skipHumanReview'])) { + $request->setSkipHumanReview($optionalArgs['skipHumanReview']); + } + + if (isset($optionalArgs['fieldMask'])) { + $request->setFieldMask($optionalArgs['fieldMask']); + } + + if (isset($optionalArgs['processOptions'])) { + $request->setProcessOptions($optionalArgs['processOptions']); + } + + if (isset($optionalArgs['labels'])) { + $request->setLabels($optionalArgs['labels']); + } + + if (isset($optionalArgs['imagelessMode'])) { + $request->setImagelessMode($optionalArgs['imagelessMode']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ProcessDocument', ProcessResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Send a document for Human Review. The input document should be processed by + * the specified processor. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedHumanReviewConfig = $documentProcessorServiceClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + * $operationResponse = $documentProcessorServiceClient->reviewDocument($formattedHumanReviewConfig); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->reviewDocument($formattedHumanReviewConfig); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'reviewDocument'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $humanReviewConfig Required. The resource name of the + * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the + * document will be reviewed with. + * @param array $optionalArgs { + * Optional. + * + * @type Document $inlineDocument + * An inline document proto. + * @type bool $enableSchemaValidation + * Whether the validation should be performed on the ad-hoc review request. + * @type int $priority + * The priority of the human review task. + * For allowed values, use constants defined on {@see \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest\Priority} + * @type DocumentSchema $documentSchema + * The document schema of the human review task. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function reviewDocument($humanReviewConfig, array $optionalArgs = []) + { + $request = new ReviewDocumentRequest(); + $requestParamHeaders = []; + $request->setHumanReviewConfig($humanReviewConfig); + $requestParamHeaders['human_review_config'] = $humanReviewConfig; + if (isset($optionalArgs['inlineDocument'])) { + $request->setInlineDocument($optionalArgs['inlineDocument']); + } + + if (isset($optionalArgs['enableSchemaValidation'])) { + $request->setEnableSchemaValidation($optionalArgs['enableSchemaValidation']); + } + + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + if (isset($optionalArgs['documentSchema'])) { + $request->setDocumentSchema($optionalArgs['documentSchema']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ReviewDocument', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Set the default (active) version of a + * [Processor][google.cloud.documentai.v1.Processor] that will be used in + * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + * and + * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedProcessor = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + * $formattedDefaultProcessorVersion = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + * $operationResponse = $documentProcessorServiceClient->setDefaultProcessorVersion($formattedProcessor, $formattedDefaultProcessorVersion); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->setDefaultProcessorVersion($formattedProcessor, $formattedDefaultProcessorVersion); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'setDefaultProcessorVersion'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $processor Required. The resource name of the + * [Processor][google.cloud.documentai.v1.Processor] to change default + * version. + * @param string $defaultProcessorVersion Required. The resource name of child + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + * default. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setDefaultProcessorVersion($processor, $defaultProcessorVersion, array $optionalArgs = []) + { + $request = new SetDefaultProcessorVersionRequest(); + $requestParamHeaders = []; + $request->setProcessor($processor); + $request->setDefaultProcessorVersion($defaultProcessorVersion); + $requestParamHeaders['processor'] = $processor; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetDefaultProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Trains a new processor version. + * Operation metadata is returned as + * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedParent = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + * $processorVersion = new ProcessorVersion(); + * $operationResponse = $documentProcessorServiceClient->trainProcessorVersion($formattedParent, $processorVersion); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->trainProcessorVersion($formattedParent, $processorVersion); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'trainProcessorVersion'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + * @param ProcessorVersion $processorVersion Required. The processor version to be created. + * @param array $optionalArgs { + * Optional. + * + * @type CustomDocumentExtractionOptions $customDocumentExtractionOptions + * Options to control Custom Document Extraction (CDE) Processor. + * @type FoundationModelTuningOptions $foundationModelTuningOptions + * Options to control foundation model tuning of a processor. + * @type DocumentSchema $documentSchema + * Optional. The schema the processor version will be trained with. + * @type InputData $inputData + * Optional. The input data used to train the + * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. + * @type string $baseProcessorVersion + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function trainProcessorVersion($parent, $processorVersion, array $optionalArgs = []) + { + $request = new TrainProcessorVersionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setProcessorVersion($processorVersion); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['customDocumentExtractionOptions'])) { + $request->setCustomDocumentExtractionOptions($optionalArgs['customDocumentExtractionOptions']); + } + + if (isset($optionalArgs['foundationModelTuningOptions'])) { + $request->setFoundationModelTuningOptions($optionalArgs['foundationModelTuningOptions']); + } + + if (isset($optionalArgs['documentSchema'])) { + $request->setDocumentSchema($optionalArgs['documentSchema']); + } + + if (isset($optionalArgs['inputData'])) { + $request->setInputData($optionalArgs['inputData']); + } + + if (isset($optionalArgs['baseProcessorVersion'])) { + $request->setBaseProcessorVersion($optionalArgs['baseProcessorVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('TrainProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Undeploys the processor version. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $formattedName = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + * $operationResponse = $documentProcessorServiceClient->undeployProcessorVersion($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $documentProcessorServiceClient->undeployProcessorVersion($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'undeployProcessorVersion'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The processor version resource name to be undeployed. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function undeployProcessorVersion($name, array $optionalArgs = []) + { + $request = new UndeployProcessorVersionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UndeployProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * $response = $documentProcessorServiceClient->getLocation(); + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $documentProcessorServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $documentProcessorServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $documentProcessorServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DocumentAi/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..b6a28df90b49 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/src/V1/gapic_metadata.json @@ -0,0 +1,138 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.documentai.v1", + "libraryPackage": "Google\\Cloud\\DocumentAI\\V1", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "DocumentProcessorServiceGapicClient", + "rpcs": { + "BatchProcessDocuments": { + "methods": [ + "batchProcessDocuments" + ] + }, + "CreateProcessor": { + "methods": [ + "createProcessor" + ] + }, + "DeleteProcessor": { + "methods": [ + "deleteProcessor" + ] + }, + "DeleteProcessorVersion": { + "methods": [ + "deleteProcessorVersion" + ] + }, + "DeployProcessorVersion": { + "methods": [ + "deployProcessorVersion" + ] + }, + "DisableProcessor": { + "methods": [ + "disableProcessor" + ] + }, + "EnableProcessor": { + "methods": [ + "enableProcessor" + ] + }, + "EvaluateProcessorVersion": { + "methods": [ + "evaluateProcessorVersion" + ] + }, + "FetchProcessorTypes": { + "methods": [ + "fetchProcessorTypes" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "GetProcessor": { + "methods": [ + "getProcessor" + ] + }, + "GetProcessorType": { + "methods": [ + "getProcessorType" + ] + }, + "GetProcessorVersion": { + "methods": [ + "getProcessorVersion" + ] + }, + "ListEvaluations": { + "methods": [ + "listEvaluations" + ] + }, + "ListProcessorTypes": { + "methods": [ + "listProcessorTypes" + ] + }, + "ListProcessorVersions": { + "methods": [ + "listProcessorVersions" + ] + }, + "ListProcessors": { + "methods": [ + "listProcessors" + ] + }, + "ProcessDocument": { + "methods": [ + "processDocument" + ] + }, + "ReviewDocument": { + "methods": [ + "reviewDocument" + ] + }, + "SetDefaultProcessorVersion": { + "methods": [ + "setDefaultProcessorVersion" + ] + }, + "TrainProcessorVersion": { + "methods": [ + "trainProcessorVersion" + ] + }, + "UndeployProcessorVersion": { + "methods": [ + "undeployProcessorVersion" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_client_config.json b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_client_config.json new file mode 100644 index 000000000000..30f1e5961a04 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_client_config.json @@ -0,0 +1,168 @@ +{ + "interfaces": { + "google.cloud.documentai.v1.DocumentProcessorService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 120000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 120000, + "total_timeout_millis": 120000 + } + }, + "methods": { + "BatchProcessDocuments": { + "timeout_millis": 120000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "CreateProcessor": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteProcessor": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteProcessorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeployProcessorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DisableProcessor": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "EnableProcessor": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "EvaluateProcessorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "FetchProcessorTypes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetEvaluation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetProcessor": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetProcessorType": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetProcessorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListEvaluations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListProcessorTypes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListProcessorVersions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListProcessors": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ProcessDocument": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReviewDocument": { + "timeout_millis": 120000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "SetDefaultProcessorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TrainProcessorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UndeployProcessorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_descriptor_config.php b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_descriptor_config.php new file mode 100644 index 000000000000..961e12f940bc --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_descriptor_config.php @@ -0,0 +1,443 @@ + [ + 'google.cloud.documentai.v1.DocumentProcessorService' => [ + 'BatchProcessDocuments' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\BatchProcessResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\BatchProcessMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteProcessor' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\DeleteProcessorMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteProcessorVersion' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\DeleteProcessorVersionMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeployProcessorVersion' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\DeployProcessorVersionResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\DeployProcessorVersionMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DisableProcessor' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\DisableProcessorResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\DisableProcessorMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'EnableProcessor' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\EnableProcessorResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\EnableProcessorMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'EvaluateProcessorVersion' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\EvaluateProcessorVersionResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\EvaluateProcessorVersionMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'processor_version', + 'fieldAccessors' => [ + 'getProcessorVersion', + ], + ], + ], + ], + 'ReviewDocument' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\ReviewDocumentResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\ReviewDocumentOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'human_review_config', + 'fieldAccessors' => [ + 'getHumanReviewConfig', + ], + ], + ], + ], + 'SetDefaultProcessorVersion' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\SetDefaultProcessorVersionResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\SetDefaultProcessorVersionMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'processor', + 'fieldAccessors' => [ + 'getProcessor', + ], + ], + ], + ], + 'TrainProcessorVersion' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\TrainProcessorVersionResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UndeployProcessorVersion' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\UndeployProcessorVersionResponse', + 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\UndeployProcessorVersionMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateProcessor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\Processor', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'FetchProcessorTypes' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\FetchProcessorTypesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetEvaluation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\Evaluation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetProcessor' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\Processor', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetProcessorType' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\ProcessorType', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetProcessorVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\ProcessorVersion', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEvaluations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEvaluations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\ListEvaluationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListProcessorTypes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProcessorTypes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\ListProcessorTypesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListProcessorVersions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProcessorVersions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\ListProcessorVersionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListProcessors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProcessors', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\ListProcessorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ProcessDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DocumentAI\V1\ProcessResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'evaluation' => 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}', + 'humanReviewConfig' => 'projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig', + 'location' => 'projects/{project}/locations/{location}', + 'processor' => 'projects/{project}/locations/{location}/processors/{processor}', + 'processorType' => 'projects/{project}/locations/{location}/processorTypes/{processor_type}', + 'processorVersion' => 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}', + ], + ], + ], +]; diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_rest_client_config.php b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_rest_client_config.php new file mode 100644 index 000000000000..7634fa638b42 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_rest_client_config.php @@ -0,0 +1,389 @@ + [ + 'google.cloud.documentai.v1.DocumentProcessorService' => [ + 'BatchProcessDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}:batchProcess', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateProcessor' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processors', + 'body' => 'processor', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteProcessor' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteProcessorVersion' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeployProcessorVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DisableProcessor' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}:disable', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'EnableProcessor' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}:enable', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'EvaluateProcessorVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion', + 'body' => '*', + 'placeholders' => [ + 'processor_version' => [ + 'getters' => [ + 'getProcessorVersion', + ], + ], + ], + ], + 'FetchProcessorTypes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:fetchProcessorTypes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetEvaluation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetProcessor' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetProcessorType' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processorTypes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetProcessorVersion' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEvaluations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListProcessorTypes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processorTypes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListProcessorVersions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processors/*}/processorVersions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListProcessors' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processors', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ProcessDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}:process', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ReviewDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument', + 'body' => '*', + 'placeholders' => [ + 'human_review_config' => [ + 'getters' => [ + 'getHumanReviewConfig', + ], + ], + ], + ], + 'SetDefaultProcessorVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion', + 'body' => '*', + 'placeholders' => [ + 'processor' => [ + 'getters' => [ + 'getProcessor', + ], + ], + ], + ], + 'TrainProcessorVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UndeployProcessorVersion' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/uiv1beta3/{name=projects/*/locations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/uiv1beta3/{name=projects/*}/locations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/uiv1beta3/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/uiv1beta3/{name=projects/*/locations/*/operations}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php b/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php new file mode 100644 index 000000000000..646e60720ba9 --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php @@ -0,0 +1,2437 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DocumentProcessorServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DocumentProcessorServiceClient($options); + } + + /** @test */ + public function batchProcessDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchProcessDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchProcessResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchProcessDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new BatchProcessRequest()) + ->setName($name); + $response = $gapicClient->batchProcessDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchProcessDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchProcessDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new BatchProcessRequest()) + ->setName($name); + $response = $gapicClient->batchProcessDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createProcessorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $type = 'type3575610'; + $displayName = 'displayName1615086568'; + $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; + $processEndpoint = 'processEndpoint-178717339'; + $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new Processor(); + $expectedResponse->setName($name); + $expectedResponse->setType($type); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); + $expectedResponse->setProcessEndpoint($processEndpoint); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $processor = new Processor(); + $request = (new CreateProcessorRequest()) + ->setParent($formattedParent) + ->setProcessor($processor); + $response = $gapicClient->createProcessor($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/CreateProcessor', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getProcessor(); + $this->assertProtobufEquals($processor, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProcessorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $processor = new Processor(); + $request = (new CreateProcessorRequest()) + ->setParent($formattedParent) + ->setProcessor($processor); + try { + $gapicClient->createProcessor($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteProcessorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProcessorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new DeleteProcessorRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteProcessor($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessor', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteProcessorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new DeleteProcessorRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteProcessor($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new DeleteProcessorVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new DeleteProcessorVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new DeployProcessorVersionResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deployProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new DeployProcessorVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->deployProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeployProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new DeployProcessorVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->deployProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableProcessorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/disableProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new DisableProcessorResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/disableProcessorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new DisableProcessorRequest()) + ->setName($formattedName); + $response = $gapicClient->disableProcessor($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DisableProcessor', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/disableProcessorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableProcessorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/disableProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new DisableProcessorRequest()) + ->setName($formattedName); + $response = $gapicClient->disableProcessor($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/disableProcessorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableProcessorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/enableProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new EnableProcessorResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/enableProcessorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new EnableProcessorRequest()) + ->setName($formattedName); + $response = $gapicClient->enableProcessor($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/EnableProcessor', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/enableProcessorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableProcessorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/enableProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new EnableProcessorRequest()) + ->setName($formattedName); + $response = $gapicClient->enableProcessor($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/enableProcessorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function evaluateProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/evaluateProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $evaluation = 'evaluation858523452'; + $expectedResponse = new EvaluateProcessorVersionResponse(); + $expectedResponse->setEvaluation($evaluation); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/evaluateProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new EvaluateProcessorVersionRequest()) + ->setProcessorVersion($formattedProcessorVersion); + $response = $gapicClient->evaluateProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/EvaluateProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProcessorVersion(); + $this->assertProtobufEquals($formattedProcessorVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/evaluateProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function evaluateProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/evaluateProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new EvaluateProcessorVersionRequest()) + ->setProcessorVersion($formattedProcessorVersion); + $response = $gapicClient->evaluateProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/evaluateProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function fetchProcessorTypesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new FetchProcessorTypesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new FetchProcessorTypesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->fetchProcessorTypes($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/FetchProcessorTypes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchProcessorTypesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new FetchProcessorTypesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->fetchProcessorTypes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEvaluationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKeyName = 'kmsKeyName2094986649'; + $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; + $expectedResponse = new Evaluation(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); + $request = (new GetEvaluationRequest()) + ->setName($formattedName); + $response = $gapicClient->getEvaluation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetEvaluation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEvaluationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); + $request = (new GetEvaluationRequest()) + ->setName($formattedName); + try { + $gapicClient->getEvaluation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $displayName = 'displayName1615086568'; + $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; + $processEndpoint = 'processEndpoint-178717339'; + $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new Processor(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); + $expectedResponse->setProcessEndpoint($processEndpoint); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new GetProcessorRequest()) + ->setName($formattedName); + $response = $gapicClient->getProcessor($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessor', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new GetProcessorRequest()) + ->setName($formattedName); + try { + $gapicClient->getProcessor($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $category = 'category50511102'; + $allowCreation = false; + $expectedResponse = new ProcessorType(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setCategory($category); + $expectedResponse->setAllowCreation($allowCreation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); + $request = (new GetProcessorTypeRequest()) + ->setName($formattedName); + $response = $gapicClient->getProcessorType($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessorType', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); + $request = (new GetProcessorTypeRequest()) + ->setName($formattedName); + try { + $gapicClient->getProcessorType($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $kmsKeyName = 'kmsKeyName2094986649'; + $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; + $googleManaged = false; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ProcessorVersion(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); + $expectedResponse->setGoogleManaged($googleManaged); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new GetProcessorVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->getProcessorVersion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessorVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorVersionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new GetProcessorVersionRequest()) + ->setName($formattedName); + try { + $gapicClient->getProcessorVersion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEvaluationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $evaluationsElement = new Evaluation(); + $evaluations = [ + $evaluationsElement, + ]; + $expectedResponse = new ListEvaluationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEvaluations($evaluations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new ListEvaluationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listEvaluations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEvaluations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListEvaluations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEvaluationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new ListEvaluationsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listEvaluations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorTypesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processorTypesElement = new ProcessorType(); + $processorTypes = [ + $processorTypesElement, + ]; + $expectedResponse = new ListProcessorTypesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessorTypes($processorTypes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListProcessorTypesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listProcessorTypes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessorTypes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessorTypes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorTypesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListProcessorTypesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listProcessorTypes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processorVersionsElement = new ProcessorVersion(); + $processorVersions = [ + $processorVersionsElement, + ]; + $expectedResponse = new ListProcessorVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessorVersions($processorVersions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new ListProcessorVersionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listProcessorVersions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessorVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessorVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorVersionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new ListProcessorVersionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listProcessorVersions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processorsElement = new Processor(); + $processors = [ + $processorsElement, + ]; + $expectedResponse = new ListProcessorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessors($processors); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListProcessorsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listProcessors($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessors', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListProcessorsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listProcessors($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ProcessResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new ProcessRequest()) + ->setName($name); + $response = $gapicClient->processDocument($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ProcessDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new ProcessRequest()) + ->setName($name); + try { + $gapicClient->processDocument($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reviewDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reviewDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $gcsDestination = 'gcsDestination714819302'; + $rejectionReason = 'rejectionReason2141394746'; + $expectedResponse = new ReviewDocumentResponse(); + $expectedResponse->setGcsDestination($gcsDestination); + $expectedResponse->setRejectionReason($rejectionReason); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/reviewDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedHumanReviewConfig = $gapicClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new ReviewDocumentRequest()) + ->setHumanReviewConfig($formattedHumanReviewConfig); + $response = $gapicClient->reviewDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ReviewDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHumanReviewConfig(); + $this->assertProtobufEquals($formattedHumanReviewConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reviewDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function reviewDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reviewDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedHumanReviewConfig = $gapicClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $request = (new ReviewDocumentRequest()) + ->setHumanReviewConfig($formattedHumanReviewConfig); + $response = $gapicClient->reviewDocument($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reviewDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setDefaultProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/setDefaultProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SetDefaultProcessorVersionResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/setDefaultProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProcessor = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $formattedDefaultProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new SetDefaultProcessorVersionRequest()) + ->setProcessor($formattedProcessor) + ->setDefaultProcessorVersion($formattedDefaultProcessorVersion); + $response = $gapicClient->setDefaultProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/SetDefaultProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProcessor(); + $this->assertProtobufEquals($formattedProcessor, $actualValue); + $actualValue = $actualApiRequestObject->getDefaultProcessorVersion(); + $this->assertProtobufEquals($formattedDefaultProcessorVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/setDefaultProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setDefaultProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/setDefaultProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedProcessor = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $formattedDefaultProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new SetDefaultProcessorVersionRequest()) + ->setProcessor($formattedProcessor) + ->setDefaultProcessorVersion($formattedDefaultProcessorVersion); + $response = $gapicClient->setDefaultProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/setDefaultProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function trainProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/trainProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $processorVersion2 = 'processorVersion2-1092580578'; + $expectedResponse = new TrainProcessorVersionResponse(); + $expectedResponse->setProcessorVersion($processorVersion2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/trainProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $processorVersion = new ProcessorVersion(); + $request = (new TrainProcessorVersionRequest()) + ->setParent($formattedParent) + ->setProcessorVersion($processorVersion); + $response = $gapicClient->trainProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/TrainProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getProcessorVersion(); + $this->assertProtobufEquals($processorVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/trainProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function trainProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/trainProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $processorVersion = new ProcessorVersion(); + $request = (new TrainProcessorVersionRequest()) + ->setParent($formattedParent) + ->setProcessorVersion($processorVersion); + $response = $gapicClient->trainProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/trainProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeployProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new UndeployProcessorVersionResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeployProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new UndeployProcessorVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->undeployProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/UndeployProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeployProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $request = (new UndeployProcessorVersionRequest()) + ->setName($formattedName); + $response = $gapicClient->undeployProcessorVersion($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchProcessDocumentsAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchProcessDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchProcessResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchProcessDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new BatchProcessRequest()) + ->setName($name); + $response = $gapicClient->batchProcessDocumentsAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/DocumentProcessorServiceClientTest.php b/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/DocumentProcessorServiceClientTest.php new file mode 100644 index 000000000000..5498508ef1ef --- /dev/null +++ b/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/DocumentProcessorServiceClientTest.php @@ -0,0 +1,2251 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DocumentProcessorServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DocumentProcessorServiceClient($options); + } + + /** @test */ + public function batchProcessDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchProcessDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchProcessResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchProcessDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $response = $gapicClient->batchProcessDocuments($name); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function batchProcessDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/batchProcessDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $response = $gapicClient->batchProcessDocuments($name); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createProcessorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $type = 'type3575610'; + $displayName = 'displayName1615086568'; + $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; + $processEndpoint = 'processEndpoint-178717339'; + $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new Processor(); + $expectedResponse->setName($name); + $expectedResponse->setType($type); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); + $expectedResponse->setProcessEndpoint($processEndpoint); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $processor = new Processor(); + $response = $gapicClient->createProcessor($formattedParent, $processor); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/CreateProcessor', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getProcessor(); + $this->assertProtobufEquals($processor, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProcessorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $processor = new Processor(); + try { + $gapicClient->createProcessor($formattedParent, $processor); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteProcessorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProcessorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->deleteProcessor($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessor', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteProcessorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->deleteProcessor($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->deleteProcessorVersion($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->deleteProcessorVersion($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new DeployProcessorVersionResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deployProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->deployProcessorVersion($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeployProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deployProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deployProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->deployProcessorVersion($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableProcessorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/disableProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new DisableProcessorResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/disableProcessorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->disableProcessor($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DisableProcessor', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/disableProcessorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableProcessorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/disableProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->disableProcessor($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/disableProcessorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableProcessorTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/enableProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new EnableProcessorResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/enableProcessorTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->enableProcessor($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/EnableProcessor', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/enableProcessorTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableProcessorExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/enableProcessorTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->enableProcessor($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/enableProcessorTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function evaluateProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/evaluateProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $evaluation = 'evaluation858523452'; + $expectedResponse = new EvaluateProcessorVersionResponse(); + $expectedResponse->setEvaluation($evaluation); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/evaluateProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->evaluateProcessorVersion($formattedProcessorVersion); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/EvaluateProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProcessorVersion(); + $this->assertProtobufEquals($formattedProcessorVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/evaluateProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function evaluateProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/evaluateProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->evaluateProcessorVersion($formattedProcessorVersion); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/evaluateProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function fetchProcessorTypesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new FetchProcessorTypesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->fetchProcessorTypes($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/FetchProcessorTypes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchProcessorTypesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->fetchProcessorTypes($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEvaluationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKeyName = 'kmsKeyName2094986649'; + $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; + $expectedResponse = new Evaluation(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); + $response = $gapicClient->getEvaluation($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetEvaluation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEvaluationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); + try { + $gapicClient->getEvaluation($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $displayName = 'displayName1615086568'; + $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; + $processEndpoint = 'processEndpoint-178717339'; + $kmsKeyName = 'kmsKeyName2094986649'; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new Processor(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); + $expectedResponse->setProcessEndpoint($processEndpoint); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->getProcessor($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessor', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + try { + $gapicClient->getProcessor($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorTypeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $category = 'category50511102'; + $allowCreation = false; + $expectedResponse = new ProcessorType(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setCategory($category); + $expectedResponse->setAllowCreation($allowCreation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); + $response = $gapicClient->getProcessorType($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessorType', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorTypeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); + try { + $gapicClient->getProcessorType($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $kmsKeyName = 'kmsKeyName2094986649'; + $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; + $googleManaged = false; + $satisfiesPzs = false; + $satisfiesPzi = false; + $expectedResponse = new ProcessorVersion(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setKmsKeyName($kmsKeyName); + $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); + $expectedResponse->setGoogleManaged($googleManaged); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->getProcessorVersion($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessorVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessorVersionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + try { + $gapicClient->getProcessorVersion($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEvaluationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $evaluationsElement = new Evaluation(); + $evaluations = [ + $evaluationsElement, + ]; + $expectedResponse = new ListEvaluationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setEvaluations($evaluations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->listEvaluations($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEvaluations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListEvaluations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEvaluationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + try { + $gapicClient->listEvaluations($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorTypesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processorTypesElement = new ProcessorType(); + $processorTypes = [ + $processorTypesElement, + ]; + $expectedResponse = new ListProcessorTypesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessorTypes($processorTypes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listProcessorTypes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessorTypes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessorTypes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorTypesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listProcessorTypes($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorVersionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processorVersionsElement = new ProcessorVersion(); + $processorVersions = [ + $processorVersionsElement, + ]; + $expectedResponse = new ListProcessorVersionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessorVersions($processorVersions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->listProcessorVersions($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessorVersions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessorVersions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorVersionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + try { + $gapicClient->listProcessorVersions($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processorsElement = new Processor(); + $processors = [ + $processorsElement, + ]; + $expectedResponse = new ListProcessorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessors($processors); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listProcessors($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessors', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessorsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listProcessors($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ProcessResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $gapicClient->processDocument($name); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ProcessDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $gapicClient->processDocument($name); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reviewDocumentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reviewDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $gcsDestination = 'gcsDestination714819302'; + $rejectionReason = 'rejectionReason2141394746'; + $expectedResponse = new ReviewDocumentResponse(); + $expectedResponse->setGcsDestination($gcsDestination); + $expectedResponse->setRejectionReason($rejectionReason); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/reviewDocumentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedHumanReviewConfig = $gapicClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->reviewDocument($formattedHumanReviewConfig); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ReviewDocument', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHumanReviewConfig(); + $this->assertProtobufEquals($formattedHumanReviewConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reviewDocumentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function reviewDocumentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/reviewDocumentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedHumanReviewConfig = $gapicClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $response = $gapicClient->reviewDocument($formattedHumanReviewConfig); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reviewDocumentTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setDefaultProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/setDefaultProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new SetDefaultProcessorVersionResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/setDefaultProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedProcessor = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $formattedDefaultProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->setDefaultProcessorVersion($formattedProcessor, $formattedDefaultProcessorVersion); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/SetDefaultProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProcessor(); + $this->assertProtobufEquals($formattedProcessor, $actualValue); + $actualValue = $actualApiRequestObject->getDefaultProcessorVersion(); + $this->assertProtobufEquals($formattedDefaultProcessorVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/setDefaultProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setDefaultProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/setDefaultProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedProcessor = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $formattedDefaultProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->setDefaultProcessorVersion($formattedProcessor, $formattedDefaultProcessorVersion); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/setDefaultProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function trainProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/trainProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $processorVersion2 = 'processorVersion2-1092580578'; + $expectedResponse = new TrainProcessorVersionResponse(); + $expectedResponse->setProcessorVersion($processorVersion2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/trainProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $processorVersion = new ProcessorVersion(); + $response = $gapicClient->trainProcessorVersion($formattedParent, $processorVersion); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/TrainProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getProcessorVersion(); + $this->assertProtobufEquals($processorVersion, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/trainProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function trainProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/trainProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); + $processorVersion = new ProcessorVersion(); + $response = $gapicClient->trainProcessorVersion($formattedParent, $processorVersion); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/trainProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeployProcessorVersionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new UndeployProcessorVersionResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeployProcessorVersionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->undeployProcessorVersion($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/UndeployProcessorVersion', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployProcessorVersionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function undeployProcessorVersionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/undeployProcessorVersionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); + $response = $gapicClient->undeployProcessorVersion($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployProcessorVersionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From dfec8df18cbb65f9f882d9090a41e18b1074921f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 2 Aug 2024 18:57:55 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../metadata/V1/DocumentProcessorService.php | Bin 17053 -> 17082 bytes DocumentAi/metadata/V1/Processor.php | Bin 3336 -> 4080 bytes .../DocumentProcessorServiceGapicClient.php | 6 + DocumentAi/src/V1/ProcessRequest.php | 34 + DocumentAi/src/V1/ProcessorVersion.php | 48 + .../V1/ProcessorVersion/GenAiModelInfo.php | 2 - .../GenAiModelInfo/CustomGenAiModelInfo.php | 6 +- .../CustomGenAiModelInfo/CustomModelType.php | 2 - .../FoundationGenAiModelInfo.php | 6 +- .../Google/Cloud/Documentai/V1/Barcode.php | 31 - .../Google/Cloud/Documentai/V1/Document.php | Bin 13032 -> 0 bytes .../Google/Cloud/Documentai/V1/DocumentIo.php | Bin 2208 -> 0 bytes .../V1/DocumentProcessorService.php | Bin 17082 -> 0 bytes .../Cloud/Documentai/V1/DocumentSchema.php | Bin 1829 -> 0 bytes .../Google/Cloud/Documentai/V1/Evaluation.php | Bin 3028 -> 0 bytes .../Google/Cloud/Documentai/V1/Geometry.php | 36 - .../Cloud/Documentai/V1/OperationMetadata.php | Bin 1280 -> 0 bytes .../Google/Cloud/Documentai/V1/Processor.php | Bin 4080 -> 0 bytes .../Cloud/Documentai/V1/ProcessorType.php | 40 - .../Google/Cloud/DocumentAI/V1/Barcode.php | 255 -- .../V1/BatchDocumentsInputConfig.php | 108 - .../DocumentAI/V1/BatchProcessMetadata.php | 228 -- .../IndividualProcessStatus.php | 208 -- .../V1/BatchProcessMetadata/State.php | 92 - .../DocumentAI/V1/BatchProcessRequest.php | 342 --- .../DocumentAI/V1/BatchProcessResponse.php | 34 - .../Cloud/DocumentAI/V1/BoundingPoly.php | 101 - .../DocumentAI/V1/CommonOperationMetadata.php | 223 -- .../V1/CommonOperationMetadata/State.php | 85 - .../DocumentAI/V1/CreateProcessorRequest.php | 161 -- .../DocumentAI/V1/DeleteProcessorMetadata.php | 79 - .../DocumentAI/V1/DeleteProcessorRequest.php | 83 - .../V1/DeleteProcessorVersionMetadata.php | 79 - .../V1/DeleteProcessorVersionRequest.php | 83 - .../V1/DeployProcessorVersionMetadata.php | 79 - .../V1/DeployProcessorVersionRequest.php | 83 - .../V1/DeployProcessorVersionResponse.php | 35 - .../V1/DisableProcessorMetadata.php | 79 - .../DocumentAI/V1/DisableProcessorRequest.php | 69 - .../V1/DisableProcessorResponse.php | 35 - .../Google/Cloud/DocumentAI/V1/Document.php | 611 ----- .../V1/Document/ChunkedDocument.php | 70 - .../V1/Document/ChunkedDocument/Chunk.php | 250 -- .../ChunkedDocument/Chunk/ChunkPageFooter.php | 114 - .../ChunkedDocument/Chunk/ChunkPageHeader.php | 114 - .../ChunkedDocument/Chunk/ChunkPageSpan.php | 104 - .../DocumentAI/V1/Document/DocumentLayout.php | 71 - .../DocumentLayout/DocumentLayoutBlock.php | 223 -- .../DocumentLayoutBlock/LayoutListBlock.php | 108 - .../DocumentLayoutBlock/LayoutListEntry.php | 74 - .../DocumentLayoutBlock/LayoutPageSpan.php | 104 - .../DocumentLayoutBlock/LayoutTableBlock.php | 138 - .../DocumentLayoutBlock/LayoutTableCell.php | 142 - .../DocumentLayoutBlock/LayoutTableRow.php | 70 - .../DocumentLayoutBlock/LayoutTextBlock.php | 150 - .../Cloud/DocumentAI/V1/Document/Entity.php | 488 ---- .../V1/Document/Entity/NormalizedValue.php | 357 --- .../DocumentAI/V1/Document/EntityRelation.php | 139 - .../Cloud/DocumentAI/V1/Document/Page.php | 719 ----- .../DocumentAI/V1/Document/Page/Block.php | 170 -- .../V1/Document/Page/DetectedBarcode.php | 132 - .../V1/Document/Page/DetectedLanguage.php | 112 - .../DocumentAI/V1/Document/Page/Dimension.php | 138 - .../DocumentAI/V1/Document/Page/FormField.php | 382 --- .../DocumentAI/V1/Document/Page/Image.php | 180 -- .../V1/Document/Page/ImageQualityScores.php | 104 - .../ImageQualityScores/DetectedDefect.php | 140 - .../DocumentAI/V1/Document/Page/Layout.php | 220 -- .../V1/Document/Page/Layout/Orientation.php | 81 - .../DocumentAI/V1/Document/Page/Line.php | 170 -- .../DocumentAI/V1/Document/Page/Matrix.php | 185 -- .../DocumentAI/V1/Document/Page/Paragraph.php | 169 -- .../DocumentAI/V1/Document/Page/Symbol.php | 118 - .../DocumentAI/V1/Document/Page/Table.php | 237 -- .../V1/Document/Page/Table/TableCell.php | 186 -- .../V1/Document/Page/Table/TableRow.php | 70 - .../DocumentAI/V1/Document/Page/Token.php | 261 -- .../V1/Document/Page/Token/DetectedBreak.php | 71 - .../Page/Token/DetectedBreak/Type.php | 71 - .../V1/Document/Page/Token/StyleInfo.php | 586 ---- .../V1/Document/Page/VisualElement.php | 157 -- .../DocumentAI/V1/Document/PageAnchor.php | 73 - .../V1/Document/PageAnchor/PageRef.php | 265 -- .../PageAnchor/PageRef/LayoutType.php | 112 - .../DocumentAI/V1/Document/Provenance.php | 187 -- .../V1/Document/Provenance/OperationType.php | 105 - .../V1/Document/Provenance/PBParent.php | 148 - .../Cloud/DocumentAI/V1/Document/Revision.php | 336 --- .../V1/Document/Revision/HumanReview.php | 108 - .../DocumentAI/V1/Document/ShardInfo.php | 148 - .../Cloud/DocumentAI/V1/Document/Style.php | 377 --- .../DocumentAI/V1/Document/Style/FontSize.php | 108 - .../DocumentAI/V1/Document/TextAnchor.php | 117 - .../V1/Document/TextAnchor/TextSegment.php | 124 - .../DocumentAI/V1/Document/TextChange.php | 173 -- .../DocumentAI/V1/DocumentOutputConfig.php | 76 - .../DocumentOutputConfig/GcsOutputConfig.php | 166 -- .../GcsOutputConfig/ShardingConfig.php | 104 - .../Cloud/DocumentAI/V1/DocumentSchema.php | 179 -- .../V1/DocumentSchema/EntityType.php | 276 -- .../DocumentSchema/EntityType/EnumValues.php | 70 - .../V1/DocumentSchema/EntityType/Property.php | 184 -- .../EntityType/Property/OccurrenceType.php | 88 - .../DocumentAI/V1/DocumentSchema/Metadata.php | 192 -- .../DocumentAI/V1/EnableProcessorMetadata.php | 79 - .../DocumentAI/V1/EnableProcessorRequest.php | 69 - .../DocumentAI/V1/EnableProcessorResponse.php | 35 - .../V1/EvaluateProcessorVersionMetadata.php | 79 - .../V1/EvaluateProcessorVersionRequest.php | 146 - .../V1/EvaluateProcessorVersionResponse.php | 69 - .../Google/Cloud/DocumentAI/V1/Evaluation.php | 309 --- .../V1/Evaluation/ConfidenceLevelMetrics.php | 114 - .../DocumentAI/V1/Evaluation/Counters.php | 180 -- .../DocumentAI/V1/Evaluation/Metrics.php | 410 --- .../V1/Evaluation/MultiConfidenceMetrics.php | 290 -- .../MultiConfidenceMetrics/MetricsType.php | 63 - .../DocumentAI/V1/EvaluationReference.php | 189 -- .../V1/FetchProcessorTypesRequest.php | 89 - .../V1/FetchProcessorTypesResponse.php | 69 - .../Cloud/DocumentAI/V1/GcsDocument.php | 101 - .../Cloud/DocumentAI/V1/GcsDocuments.php | 67 - .../Google/Cloud/DocumentAI/V1/GcsPrefix.php | 67 - .../DocumentAI/V1/GetEvaluationRequest.php | 91 - .../DocumentAI/V1/GetProcessorRequest.php | 83 - .../DocumentAI/V1/GetProcessorTypeRequest.php | 83 - .../V1/GetProcessorVersionRequest.php | 83 - .../Cloud/DocumentAI/V1/HumanReviewStatus.php | 155 -- .../DocumentAI/V1/HumanReviewStatus/State.php | 82 - .../DocumentAI/V1/ListEvaluationsRequest.php | 177 -- .../DocumentAI/V1/ListEvaluationsResponse.php | 105 - .../V1/ListProcessorTypesRequest.php | 165 -- .../V1/ListProcessorTypesResponse.php | 103 - .../V1/ListProcessorVersionsRequest.php | 171 -- .../V1/ListProcessorVersionsResponse.php | 103 - .../DocumentAI/V1/ListProcessorsRequest.php | 166 -- .../DocumentAI/V1/ListProcessorsResponse.php | 103 - .../Cloud/DocumentAI/V1/NormalizedVertex.php | 103 - .../Google/Cloud/DocumentAI/V1/OcrConfig.php | 378 --- .../Cloud/DocumentAI/V1/OcrConfig/Hints.php | 90 - .../V1/OcrConfig/PremiumFeatures.php | 142 - .../Cloud/DocumentAI/V1/ProcessOptions.php | 300 -- .../ProcessOptions/IndividualPageSelector.php | 70 - .../V1/ProcessOptions/LayoutConfig.php | 80 - .../LayoutConfig/ChunkingConfig.php | 108 - .../Cloud/DocumentAI/V1/ProcessRequest.php | 457 ---- .../Cloud/DocumentAI/V1/ProcessResponse.php | 127 - .../Google/Cloud/DocumentAI/V1/Processor.php | 438 --- .../Cloud/DocumentAI/V1/Processor/State.php | 107 - .../Cloud/DocumentAI/V1/ProcessorType.php | 280 -- .../V1/ProcessorType/LocationInfo.php | 74 - .../Cloud/DocumentAI/V1/ProcessorVersion.php | 574 ---- .../V1/ProcessorVersion/DeprecationInfo.php | 114 - .../V1/ProcessorVersion/ModelType.php | 64 - .../DocumentAI/V1/ProcessorVersion/State.php | 106 - .../DocumentAI/V1/ProcessorVersionAlias.php | 101 - .../Cloud/DocumentAI/V1/RawDocument.php | 155 -- .../V1/ReviewDocumentOperationMetadata.php | 113 - .../DocumentAI/V1/ReviewDocumentRequest.php | 247 -- .../V1/ReviewDocumentRequest/Priority.php | 62 - .../DocumentAI/V1/ReviewDocumentResponse.php | 141 - .../V1/ReviewDocumentResponse/State.php | 64 - .../V1/SetDefaultProcessorVersionMetadata.php | 79 - .../V1/SetDefaultProcessorVersionRequest.php | 123 - .../V1/SetDefaultProcessorVersionResponse.php | 35 - .../V1/TrainProcessorVersionMetadata.php | 165 -- .../DatasetValidation.php | 189 -- .../V1/TrainProcessorVersionRequest.php | 348 --- .../CustomDocumentExtractionOptions.php | 71 - .../TrainingMethod.php | 59 - .../FoundationModelTuningOptions.php | 116 - .../InputData.php | 125 - .../V1/TrainProcessorVersionResponse.php | 68 - .../V1/UndeployProcessorVersionMetadata.php | 79 - .../V1/UndeployProcessorVersionRequest.php | 83 - .../V1/UndeployProcessorVersionResponse.php | 35 - .../src/Google/Cloud/DocumentAI/V1/Vertex.php | 102 - .../batch_process_documents.php | 88 - .../create_processor.php | 80 - .../delete_processor.php | 85 - .../delete_processor_version.php | 86 - .../deploy_processor_version.php | 88 - .../disable_processor.php | 87 - .../enable_processor.php | 87 - .../evaluate_processor_version.php | 92 - .../fetch_processor_types.php | 74 - .../get_evaluation.php | 79 - .../get_location.php | 57 - .../get_processor.php | 75 - .../get_processor_type.php | 75 - .../get_processor_version.php | 76 - .../list_evaluations.php | 84 - .../list_locations.php | 62 - .../list_processor_types.php | 77 - .../list_processor_versions.php | 82 - .../list_processors.php | 77 - .../process_document.php | 79 - .../review_document.php | 90 - .../set_default_processor_version.php | 107 - .../train_processor_version.php | 94 - .../undeploy_processor_version.php | 88 - .../Client/DocumentProcessorServiceClient.php | 1075 -------- .../src/V1/DocumentProcessorServiceClient.php | 34 - .../DocumentProcessorServiceGapicClient.php | 2123 -------------- .../DocumentAi/v1/src/V1/gapic_metadata.json | 138 - ...ument_processor_service_client_config.json | 168 -- ...nt_processor_service_descriptor_config.php | 443 --- ...t_processor_service_rest_client_config.php | 389 --- .../DocumentProcessorServiceClientTest.php | 2437 ----------------- .../V1/DocumentProcessorServiceClientTest.php | 2251 --------------- 209 files changed, 92 insertions(+), 35656 deletions(-) rename {owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI => DocumentAi/src}/V1/ProcessorVersion/GenAiModelInfo.php (95%) rename {owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI => DocumentAi/src}/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php (91%) rename {owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI => DocumentAi/src}/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php (89%) rename {owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI => DocumentAi/src}/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php (90%) delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Barcode.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Document.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentIo.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentProcessorService.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentSchema.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Evaluation.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Geometry.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Processor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/ProcessorType.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Barcode.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchDocumentsInputConfig.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/IndividualProcessStatus.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/State.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BoundingPoly.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata/State.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CreateProcessorRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity/NormalizedValue.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/EntityRelation.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Block.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedBarcode.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedLanguage.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Dimension.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/FormField.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Image.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores/DetectedDefect.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout/Orientation.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Line.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Matrix.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Paragraph.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Symbol.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableCell.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableRow.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak/Type.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/StyleInfo.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/VisualElement.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef/LayoutType.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/OperationType.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/PBParent.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision/HumanReview.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ShardInfo.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style/FontSize.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor/TextSegment.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextChange.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/EnumValues.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property/OccurrenceType.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/Metadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/ConfidenceLevelMetrics.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Counters.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Metrics.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluationReference.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocument.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocuments.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsPrefix.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetEvaluationRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorTypeRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorVersionRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus/State.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/NormalizedVertex.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/Hints.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/PremiumFeatures.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/IndividualPageSelector.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor/State.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType/LocationInfo.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/DeprecationInfo.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/ModelType.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/State.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersionAlias.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/RawDocument.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentOperationMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest/Priority.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse/State.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata/DatasetValidation.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/InputData.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionMetadata.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionRequest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionResponse.php delete mode 100644 owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Vertex.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/create_processor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor_version.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/disable_processor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/enable_processor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_evaluation.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_location.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_type.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_version.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_evaluations.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_locations.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_types.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processors.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/process_document.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/review_document.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/train_processor_version.php delete mode 100644 owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php delete mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/Client/DocumentProcessorServiceClient.php delete mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/DocumentProcessorServiceClient.php delete mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/Gapic/DocumentProcessorServiceGapicClient.php delete mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_client_config.json delete mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_descriptor_config.php delete mode 100644 owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_rest_client_config.php delete mode 100644 owl-bot-staging/DocumentAi/v1/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php delete mode 100644 owl-bot-staging/DocumentAi/v1/tests/Unit/V1/DocumentProcessorServiceClientTest.php diff --git a/DocumentAi/metadata/V1/DocumentProcessorService.php b/DocumentAi/metadata/V1/DocumentProcessorService.php index 0a8e94e861ce2e8b04e5d7d07e12b91875769324..e7836836126f4e73b30d63367d9719b7afea5b3f 100644 GIT binary patch delta 53 zcmbQ+%DAhQaRVnC`XIkSiJ7HEl1po%x7OqU<{eDk{F}L0%9&(^qPYaqQ}f~zGvjmfQ&Mx{GxO5& zC4>|hHMoteCnvDTOt$9|;Ma3c&2!B31u5_Z%1^FgTW&4Y!OF#lDlSyRC6kt4nwOGT zl9`_uk7+I=*xV49xqfKo>bb!+qZ;hNAXLI7kz86_lAnvkSSGNs0Wf3h(T#NmYeY9v zDw<0ImxV%7TtaD?d8s9(d6{|X@rgM(`Q@o85+L_;2q|+(=Vs=`mlP!e$(+Qb)ST3m z_>}zQ(%jU%l41!aE1)V?scB4HBG@bzs^$`e`UDcjQXw1fZ+ z5mMxmOiCj;1pv_MJ delta 36 scmew$-yyX@iJ4`NFqhUuZ>`Az%sZGCb8hBhDQB8|k8ROrZmy@S0MR diff --git a/DocumentAi/src/V1/Gapic/DocumentProcessorServiceGapicClient.php b/DocumentAi/src/V1/Gapic/DocumentProcessorServiceGapicClient.php index 3a2e5f38e55b..88bdfe8dff6b 100644 --- a/DocumentAi/src/V1/Gapic/DocumentProcessorServiceGapicClient.php +++ b/DocumentAi/src/V1/Gapic/DocumentProcessorServiceGapicClient.php @@ -1819,6 +1819,8 @@ public function listProcessors($parent, array $optionalArgs = []) * (Unicode codepoints) and can only contain lowercase letters, numeric * characters, underscores, and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. + * @type bool $imagelessMode + * Optional. Option to remove images from the document. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an * associative array of retry settings parameters. See the documentation on @@ -1863,6 +1865,10 @@ public function processDocument($name, array $optionalArgs = []) $request->setLabels($optionalArgs['labels']); } + if (isset($optionalArgs['imagelessMode'])) { + $request->setImagelessMode($optionalArgs['imagelessMode']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); diff --git a/DocumentAi/src/V1/ProcessRequest.php b/DocumentAi/src/V1/ProcessRequest.php index 80d84227d6ab..e240c01e3e89 100644 --- a/DocumentAi/src/V1/ProcessRequest.php +++ b/DocumentAi/src/V1/ProcessRequest.php @@ -64,6 +64,12 @@ class ProcessRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; */ private $labels; + /** + * Optional. Option to remove images from the document. + * + * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $imageless_mode = false; protected $source; /** @@ -127,6 +133,8 @@ public static function build(string $name): self * (Unicode codepoints) and can only contain lowercase letters, numeric * characters, underscores, and dashes. International characters are allowed. * Label values are optional. Label keys must start with a letter. + * @type bool $imageless_mode + * Optional. Option to remove images from the document. * } */ public function __construct($data = NULL) { @@ -411,6 +419,32 @@ public function setLabels($var) return $this; } + /** + * Optional. Option to remove images from the document. + * + * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getImagelessMode() + { + return $this->imageless_mode; + } + + /** + * Optional. Option to remove images from the document. + * + * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setImagelessMode($var) + { + GPBUtil::checkBool($var); + $this->imageless_mode = $var; + + return $this; + } + /** * @return string */ diff --git a/DocumentAi/src/V1/ProcessorVersion.php b/DocumentAi/src/V1/ProcessorVersion.php index c272716b922f..7ed1c24a6e3c 100644 --- a/DocumentAi/src/V1/ProcessorVersion.php +++ b/DocumentAi/src/V1/ProcessorVersion.php @@ -98,6 +98,13 @@ class ProcessorVersion extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $satisfies_pzi = false; + /** + * Output only. Information about Generative AI model-based processor + * versions. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $gen_ai_model_info = null; /** * Constructor. @@ -133,6 +140,9 @@ class ProcessorVersion extends \Google\Protobuf\Internal\Message * Output only. Reserved for future use. * @type bool $satisfies_pzi * Output only. Reserved for future use. + * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo $gen_ai_model_info + * Output only. Information about Generative AI model-based processor + * versions. * } */ public function __construct($data = NULL) { @@ -522,5 +532,43 @@ public function setSatisfiesPzi($var) return $this; } + /** + * Output only. Information about Generative AI model-based processor + * versions. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo|null + */ + public function getGenAiModelInfo() + { + return $this->gen_ai_model_info; + } + + public function hasGenAiModelInfo() + { + return isset($this->gen_ai_model_info); + } + + public function clearGenAiModelInfo() + { + unset($this->gen_ai_model_info); + } + + /** + * Output only. Information about Generative AI model-based processor + * versions. + * + * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo $var + * @return $this + */ + public function setGenAiModelInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo::class); + $this->gen_ai_model_info = $var; + + return $this; + } + } diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo.php b/DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo.php similarity index 95% rename from owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo.php rename to DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo.php index 668d2517f811..a01a78bd2c83 100644 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo.php +++ b/DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo.php @@ -106,6 +106,4 @@ public function getModelInfo() } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GenAiModelInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_GenAiModelInfo::class); diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php b/DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php similarity index 91% rename from owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php rename to DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php index 886298d2f206..b87cf1344c1d 100644 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php +++ b/DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo.php @@ -22,13 +22,13 @@ class CustomGenAiModelInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType custom_model_type = 1; */ - protected $custom_model_type = 0; + private $custom_model_type = 0; /** * The base processor version ID for the custom model. * * Generated from protobuf field string base_processor_version_id = 2; */ - protected $base_processor_version_id = ''; + private $base_processor_version_id = ''; /** * Constructor. @@ -101,6 +101,4 @@ public function setBaseProcessorVersionId($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CustomGenAiModelInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_GenAiModelInfo_CustomGenAiModelInfo::class); diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php b/DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php similarity index 89% rename from owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php rename to DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php index 7b813eb078d9..df7b1650cd1c 100644 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php +++ b/DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/CustomGenAiModelInfo/CustomModelType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CustomModelType::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_GenAiModelInfo_CustomGenAiModelInfo_CustomModelType::class); diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php b/DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php similarity index 90% rename from owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php rename to DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php index 52e91021b187..407eac289e11 100644 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php +++ b/DocumentAi/src/V1/ProcessorVersion/GenAiModelInfo/FoundationGenAiModelInfo.php @@ -20,14 +20,14 @@ class FoundationGenAiModelInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool finetuning_allowed = 1; */ - protected $finetuning_allowed = false; + private $finetuning_allowed = false; /** * The minimum number of labeled documents in the training dataset * required for finetuning. * * Generated from protobuf field int32 min_train_labeled_documents = 2; */ - protected $min_train_labeled_documents = 0; + private $min_train_labeled_documents = 0; /** * Constructor. @@ -103,6 +103,4 @@ public function setMinTrainLabeledDocuments($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FoundationGenAiModelInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_GenAiModelInfo_FoundationGenAiModelInfo::class); diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Barcode.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Barcode.php deleted file mode 100644 index fc1bf55a7ae2..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Barcode.php +++ /dev/null @@ -1,31 +0,0 @@ -internalAddGeneratedFile( - ' - -(google/cloud/documentai/v1/barcode.protogoogle.cloud.documentai.v1"B -Barcode -format (  - value_format (  - raw_value ( B -com.google.cloud.documentai.v1B BarcodeProtoPZ>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipbGoogle.Cloud.DocumentAI.V1Google\\Cloud\\DocumentAI\\V1Google::Cloud::DocumentAI::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Document.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Document.php deleted file mode 100644 index 152f7b5e639f008facefe03c4ed44df177e352e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13032 zcmd^GPi!Ms8Lyq#v7htDJKgP?0gAh=+AOpVn=PgFc3bS&N!(3h*KxA_V`&)M&&f1n zkC_?oZh&4vTsU)q0}`m>))NOVhyxOE;m8FEA%R2>TtPxeeBbxp%-C5sj5pp>_p+Hc z@B7|+-=E+2=Z#-~b8tLh&t|uHpWC|2JK5H0);;Fgfo-`~+cLAQVYkceY}@J$43pcr zY_?R*?o}Jva;egI21p%iXt#Mjdt_NhCSPlt*08hIvD(8P@4LFOcJGG&lq0T;_4OWi z26~%kw`#>*?&=-g)tg(ypt*qznkAn>^YF$k#@eRtI9YF$eTQY?-(c7>jds>?br=47 z&TurNZ@7kT8sCPK+|G7&)8Rn;@Z9dO-*yeFpGAUdzs*;#X9Z83``o~Sli$vITdJWj zKoHGJ-{p2+H=8Byv~6SHT6PVl=JQ9~^+kvytJmeS$j<0ySH&Ll`G+=nJL}p*KDv4~ zYjbyK_ixd@k->-lU(E>uD-4Y0roqilkss^#49m{vgHr`eCXr5%b+f43ZL7mC#$=0I zJ?`44;ko!SZWv%3uHGAjr>zg#&3!O}p%b2_aXR454a=NHTtrg>H<@x7Byr(bQvS9h*C!A`PEyG;jbT`4pSAAnc(|dvatJ!4NLp!&kim5rm zfn0zCxqCO%)pOXigxLv*P|sWNNZOX1`X$MfumzlS4JAzmBqv;z6YN2I4aUJr&b)BJ z6xIOiEL*;KN>b1Zz$Pxo<=NK!aa?K=vmRuLb=4|UH-t$%=`4p z220_P=D4ROcQUc;+-hq5%Q5p;Ir>R$ua_O>nS4adkm{a`0wl$RIPlKdHtJ`(BOO`*U{w>O4 zWUop|8ob_bAA@+&l~U{BRa_u4R1aYSxm;@9R}VT{jsl1BB1^aQ_Q{bAd+TUoHoD>D z*>IFDc(Hb$8%M{|L&4oy;GE!_=)+gp3XOGm+k&JFln-8qFE&|{I5?2sfG^=f;nYZS z$!)^w`#_39B|crfXPBqpPQYA!o+bPVi)^0OK+#1Ncp5^QM1n}Fzq!ul$+3Y8LW0&G z_F7zsIi|e9Vnz=}GfT9+a8gHhxeAhj?wD)qeWz>LJ2Q~~A+-ko>mLo_kPe_TVsJkExk{49j%1;{ z$>J^3YM*#`K82u*NT+NuHqdST$kqqP9;#0vqnbwx_#QKjz7Ou

|%j17vs**E#`J zNmQTWAPuBbYHS4%a;TdcH#ycE4&X70_v_)sdq@n*f}Xadw=h<+DWU@%seyFLHu{&{ z)4G_IJDC)5nL@amKuj6EQeX?tX|H9OPG*s~OksihM5r{_CEo&NlI3Jph}mo5CFB{P ztPYg-*k$r_?OPyuh|`(_SOpRj!R7VvjLGfa7EJbu2brdA-Q#@#aGps|10+5fCN1i# zEE)Ln5{un8I_@#WgQ&91;>QArF{KJXj?yRyOfi8+D?#doV7Leg)=18Uq)El+jI^;4 z&X|P7Q~(hPO8}&{b>E>K#1K{?WH^LR^yH^;^n^7rrE!bupQ9`;@nkl!4WbStlwG64 zQNlt1Z?dHp#xbLRqzxaV+TR>37hmo>q!P1Ds^|Ew!^wt)OMJXr`D&4lq7ypIb)fp{yf5##wAdL z8XYTkgqY>^;)TSSYXGNf8*Co`S1z-3O*}^-4#c<0(9GY~1$^kYt$%d6JmXJ3U9@I%MY_C0kYp+E|zYijzJ%v&r(icv(4~ zWeDthq%5Ps68_1zp_9T*$aEvqRvpAbh;RcqsK0~Ug~sq{q&k1pWG&4SpbkVW(I$u~ zFai!QMnpRQm_)7qeU2rALJ#^LR4r znjijy&c%gYRDtV+3~g@``-@vJgb=}<&_*=WRHi^>X^Sq*2|v}ay(W8VUtpJmcajp{ zVtXwKz4Otm8>7$kNrn1@2wU+p0CCMR1KWL>Ey!|S=4H>G2TihWS8ublw-vvabcHQ> z3Wg?TN0?s{gYnrSQT=U%DHAGo;4sz)AOnsnoTYse>hLbeAFEyL&D=R}uj4u7!^`;z zWr=vI>ulLOlNiA)gVc|>F!>;VjI+4BVW`ZaT})Rpbo+vt9R)cYiYlLDi`bNcMx?Mh z>Mw}dR~hqO8J*D^8+b7yd9>lEpn$Copn<5#&Ng<1L)#-}xX(K}c4eWj26-VZp#Cb#R?h5Sxz18_n>Plje&3TyI&x>iX9!x8|2h8gh5;h+10hceRHqg|+9W2w>iP!zyzu?;(iip0B)g3WWd>JdXoHmCk+4th<# zb1878MJ{Udu9xtHZ$yjZQte#lUG=|F=xG6K_#1VAd`XCNsDmg*(v(RTbK(XV_cKjB zIlfv>G_V?Aro!DaEGfBz?gVVbG7)s2(%Dv_u-?$ELc#yjQ106ILHWUEur>e)L$?p=-$wNg)VT8y)0Ph_`v-*`t-Mp- zg-&8RMz0ISopL&kZNtrKeOH5);!Y{Opnin9^|1rWYp_#s9ZPzMQNLiBkQ9Y4p10Tn z+^hiRdujeFo|m3`WgDym`bTo87(^69=`OE_Y`gfo%~b(!sTGSVRbOLq$(For^c2{@ z78Wfs-ZKZf1~u!_7&GN*rdDg^x@f~r(8>avE0jv06X-A0%e&RXGAIQ8KB$!njdFSc zo3-_FZ3mkYbJ#v8AA(Bi<+l&Y`wi&k&a2S`qVy7t7izUSuqdTtG<=yY((wMBO05Q? zaU4~D7G(+l)_aA;z*peDn3@iNU{8Wq+EyFBiGd4YN(y0+k>b1@Aug0g35rl8Ob}xL zUgFz@Bp`RH4Q(s{dHnW++#bk)vd*ymB=0=A zZRCJY{JwgVrA8i6clc3@m$ZS*=uw099mEU5wqk|K-*b3!i<4pX|B?M2p0Z>0qu_wo;iJO6* zYzMXQ_LQWWTE9D^MLp<+=tPTwZCa3&V*fxB>xo?Aof)r(3wR5{`Aoxc<$40pXMDaL z;O{L5AVen%@&ZE!PAbMldUH72^I|C7hf-gCg)Iw}dm~uuV049Vq#)u8Y{ymrjX}UC zeaF=AK_Mptlcy>wHQ+%eH(uc(93U`KVf-^Q(*HzQT5iPGp>i_buM&PSV-fm29neg!cFUno}bi z@|{cRu|@J^h<|XE>LsBwmI*Fbh6PUjTANH>{lN2(V8Y`PP!aCB2t(9=$Jol5Ps<<= zkJG1W-uc7by`JHcqi6L;&{d|ts6B|^um!M{fkKGBfEUO~sRH^#a&H~gdnVoe_yBR}8JjX~>H@OIGpMO59QA8q6|@JAbdK2@mX z4sZP4d)bsf>F|HkQK&TGM;)I;zbJ_Fd7{qez1Ea diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentIo.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/DocumentIo.php deleted file mode 100644 index 0da52cce58e734b3ad3a45c723f227d6f76e65eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2208 zcmb7F-EJF26pj;;#>YubR{>lD?ZhdHBg#fL;$}liOd%HbSLH6OTD$EW|iq`(7YYf8Q5g z8nQ@HzJJjw{<&P(#xX!dLndSDG15KjJZ6geRMA1#_!vCWJ_g5ykHLBC0Kf~Vlq9$I z1pER7KXEz?xJRU-3cv1g>GFsxP6PfkrgKO}G>{D8FW()dk*Bzbhz9f{k2Uv5=2PFj z7Yj`PkmRJ!v?8d+pcg5YL^K#2GwCHfRw6mWtBx~fs?bqentQXb+8rN}X2#KRULtu& zRFbmA=!7IprAc&Pcxwlj#jn8?k`?SuI1Bv8R6cW@d0KNXCacdL@L3K=zF$y2!S`(z zL3GGn_+ta^zs;OEMX)5+fvx}FtA>91G#rgoMF}RF=4g zg;8tOdJi_U198EUfW{_|)y^hVd?po-aBzvJ@y`mB`(84u4+mB!*raln^QYI*FHrWW zhFIHhn?-aOFzgw{FPIzqBR8grL{&@&ty??r;p_?zk+b__it|!UUFnI0$=W-p*}C-+ zY*GJ$;$ZY$;U%t!HBnhx#day{tY$9cG#rYcwq`(gz|y-SRm_!YiX3<}618=G)>*EV ztUcJqjyCK(RFrx+Ox>Y)j=K3wF*A^BU|jX#UF?sLr=dGy6sI9FtKdnc{l%NffeoY4 zCo^#UF05t>Vb2CM8mBt-OlCa-%5?$N7ckaf7w+bHvLNG!)tEe6psP!4-Kt-ic_t;+ z#>`1b)kLd_Dr!moD#0Dp>zaHz)x11=!c6(I()SOtD$d812=~XL*s{2DY0MYaF6Hs? zz%RCGJp6sR-Zh)nHk-Dn|D&FL-ug2?9L)A`v51d)1Kh-aFMphY9mk*@C+Bz6bDZW3@R?jlh#7!60# z)a1-`W@xWs2>C^eAVpu&<{?P>hZF?@6hR&e6bbT@KBVwN&?Z10Tol*{)tOvx|ko!dhW`E2&+x-zjxWwcpbW zSJ6w4ZhN0(;HqklW7@K#*^hKpE7E-sGL)X?Sc<9@7Mryd%~d*zt86S%mK*bg<;H@? za^u16IfT@%;y4BIZBuY=F~;Z#D!_kMf3vHr1;-Xk#$3Nb)~C+5p=y<*iyQV z2F!-nZuJe-)lH*72-XZ$yLzp_c#^eOEE8;Vw;)7>?OhX0wb3wK%{G+o#)9Ukwr;tm z-Grr;%C_cuMke1}y~ejC?DVa|RVHJlG9={Pf@}A+;O>Qjt+{>Mn4@wN27BJWHX;mI zwe*duVVJ}Urr}g7zD_=iIKug^4hK0J%{^V~c52#=@<=!B(MZ=d?og?PjBpRnS<>&F z#HC>#4WE{}qxF=-@v1*kx_x?%hvTzmk$?wx5Ycuxc3%7)5u5g|rKM-JY#Q5k-!ODz zd&5&~1V8t}7lNnWv)tYETYIF`=T{Wx;Q?sdI>4W+^sMx>>z2CFf`IPFs7Vp(=36?) zqiUz)!OuMa@~a+T5cqfv{pLe7cL)T>c}85M@L%-dzxe2Oews5@EFIDVK@$f1`IiF^ zwg_a%n;bLvf(wBKHU|d&=o)`SH}o=0IN$K4H&QH>b(62Ym1ea=BbifNPoU7eaOI0% zPgrb}Hn zOWD?-oakyQLgs3&TrDzjquj9==2mQYteU{7#ThMq44*}4%Qky5h-14m$AR%U ze2dWp{Z=zNGau*Q-9gAyZCN#qEq!|?Lq&KcNrW}ko~Mg(3%$@)cFn#ks3$4)n@Q9I z3M^B4#;-Q^Q8j~?&`IW?viV4}ZM~z-Oi;G7No++a#j+ITl>d1Koe1*B9duIN=^GCL zX@$g0-+M`{6C^Iqb9Mm*^6#Um@Yi@63O=$>cA#>jCLU+HzKSmBhT83SG+BWv%>gHn zcQmB~0y;BU(0YPtas!=@K5017apFS`a2>nKxYkY}ME%NEjBQQ&yJMaYu4{kRhfVO? z=%j9RbwiT{*3BHFCcctn2Vr9HqqorsTY2nLGsoR{Es17R43JTREx@lD8 z%6TEQ#nGYYB||)qPQtgO>X%Ixzcg%eudlDKt)Dt3{Y?g)^rJC!rlz>+jwc+8*jQ&@C82Bq0t?X{ zo<%;Dv@zX6#FEn>3^=4W(Rsm124E+gRhAh@4#|~oC9xG8*C-+97#WTPZYGWk9yDV|WUo`ReL?eR-KYK1Lq% z&+vF0BXs;;wXqEUJ}!M8tG9cgLYZ-K5S$Evf#z&_DK8+?> z4NfXE;wj@$QnB*MH6LmQ&quo`A0@@nDGD{>NkjY4Wj6x0H4$f0dVuly{LtcS~%<7P_@Th6{UC8 zCOQ*jE!f@(vE>#-X)FjONCmi}wx%U0Q&;*VQ~v;v`3B za|68;y@g0pcp0vcX0K-&UYCQSXD+!qo~I;Ub5C#s00ot-uDSdCR4NdaqPJj2CsC!N zRtPbVSZNi#eBbEA$i&Ls!$*&V3h|q8#jW@?&q?*a&Y<)2v^et)TsZHc(EKiBF#*Oj zi{;Acu$Wvbvr-G4A8>mi)gkb48%+-|O)@I0sS>Z4aX|#q*9~Q}>*K-^NPhuM4>9F# z1BwkidQOV9!GgMT)SBhd%rIB3+RpH^=cL<@Gw2g7&0Wy8lz!Jw`2&dlR?x4>oqV!3 zN{+_&(S;7%Auzq=*@<-`Y6nTpSCEt>J2$4Cv?|H0tod-DSor=Vda-RQy5Zr=fJOg2 zgCw;NjmDnWF_59`v=urp_PSgw96v}(+)3LM=jj%rA5ix;;9YQNA$~c7UfweM23$O$ zRG_V_uI%>76wH(21iiW4Kd=<{JpL=tDeJZ=cVC1U$W2xLK~6mFL9QrxIP{KG?@$CL zO>a>e%B=eh%|dc*O>8s@`v#ic_;U#Hh7i1jz}vdD16z=`h8BPm>posa=QkBciwGvt zzn!Fu^8b=SlO7#@A7St=nAyX*3Kd0j?0`M06*T3-T|K~#^(+p?F8}}FiTn5~@z#@` z8a>V3F+22TI91+0uxa+er`5RQMbGGP>AauQo`VKwhc0m(~^rx}?wn zU0GYGFUz$mX^CdwYCF}guQZoQLzR7(&CBS;q&R^VOO9#|qa@8@Qwcu3cm>ULHN~b! zOWwbcdjRFS1w&Gs8YfHrp>{gh2H5H<+m2L0m#8koD8;ao^zetHizWc+_hT`{&j(Vm zg)UP4sRKhKIGQU%CtYX2#Y6tRk-b1jTO`p1JRf*0aTiT9{~q3rj4^WMquee3&(QlH zmf=NoRz#}|Q#fegr~sxeJ=bx35uE|`sVRaFNf?gf>j5mIPsKejss%TTrb3*EgOMRg z#9HaE#?U!7pb)?(3cW)Qw4gl@>f!UAH!C?_r?>Z;=(@1Ta9=Di{@`uz0-DiiRm$-^ z=re2>wTvb#8(uNe-Cf$VpDI_9yeLw0m=`e)q?azl6B&ec>_^BT(q%N^F@zrELj7L# z{&E}UEzniGzrI*sZJ!E`js6R+GlOFB0ETwfU{94A6EBM9H|cIol|Ma-%8WPd-fE=v zYioZBgL6_oz@5r5MYC>hpH}M$G_hWPw?5ydm>6oWW~Hw~HVEr9bZw8i4;8Q!ex@b_Uh$%{(>w1 zi!2iJSFr{s0u|@L&m(_5Njh&W(@*+N=2?}#EAZ7{{qMK3f0>cqAn)})A#V@dg(`z! zh*O#^bxoDtMaaM5Yxb@$eAuh-PnFEuFrf}pHJd)3Vr-DV>1712Av8{NyxW2v9mF_TBtF?%&;1C zTp@R=Xs1F$#N&U4OTl0-E{KUy+vfKQBK@h$Z|_B1Kf_g%dCn{{ql0ctm_fGP*?&2m_7Onv&iRp6~*$ zQO(kx@UU9s)PIv17-tKelTSSqUxGv^btiS0`IJ1`TH$CDIwpd)uUPcy;V);0<|*Rb z5=9*tmv9=P`@%^x2OrChKhI}6GYLZ zG{N733EtUn+(~Q^wTB7pX;;2$u=KEloh4^Ww zhkda#(1NGD6vnxTTiRE;=(;{@EVNsTeD2Zv~a$M{~Ht=7lbE1a(@ z&})yGIujfHeHKlH+keT0e|T+5Tl@rUaVNHQx?lV8Sv9IxP2EG4zCcY9(aTO_oD!vD zDzP^9Ud5(=5g@t}#6&-bEXEr^L#@f=EEY$V(rmwASuCClE9&sR&BkZd;pq~!Ur*Wz zyOgNyQ(4b*L{Vl!!CTQ-XKlz*#FEhDeF2Jft`M{vapLRsp{2rRDf@Ji90dP$+#Crg z{Sfk1D{;+0Yci3+W+_buiyJgzF+7HIiOYkOP0_N88 zBI>GoQ}iQw1GSm?>|3l4A^uhnUe4Y&gMUg2q6L1vK+&zuIbVEh^9R}dBK?Je;yn3< zf}*!qqxj(VQ}J+v|9*k@H|f>J2K<7-Z?l&eaiv13D;1x-Qi12yFO4=WYeMX>KI{|z zuf0G&_K9fC2JXsEiL7Kz+Pz`m`fYUuNxr^=C$h|Yz3{So%AGfl!$Q}5{Wb4zk8iM_ aHVFI@0{MdjU5)q^1iF&_TEQOLL+Fn)6;O+#=$J$#!GZ*6 zJVWA=pg7@z`<$V1HkptF`8qrNIFr9FjD~K0(L*qf;VqfCU~MYn)L>;f%T^&gi1G58yML zrl?qbrs3cRK=K!7V@7?H3M}N`Lz;RtqJm;Zzn8~4KoiVTA|Y~o~CH%(TlUo24z1R4C6<`7NOV}V$ z7J65hWs+e{1Alr8;OAJ9Y!+T7Ld|7@|E%?zK7^#L0W|M9?VbKV?pCivRbBAlM+0ihOXgefMz7O39}Jwcj^ho#>O0=~*|WaW zai6+Qck7P14flHeq1!uapLjhPvt^jC!gjfIdVVr=`zOv;MMVyrFV5Y8)6FASRAjkS zMy?*!U^CYs_r}Ig22_h4Ghc`8VvIaFDO5-o(Q{HY--Dg<6K0Hm>xCH;G-kwOcuZKT z^{krj!u>cQ6Z#zq)R@s|>hZ{1>I|bZS4Hm@arfrtx^cIGuX=xzae+R&QymFNeGB zS{JR~ijSlDMNr-ZZFeNEfX+CN8W`8_eg^|%(n#V zlJhGfE*SBASGd%*$$8l8F`rO(;BlMzIw7?a^7N!l>a}Kj15E=r^eHn)-*x*ot5Dkw zyOpj>!vS-I#VeP)6?SRap(VKM=n5CWu?8&gEXqiub$HB#)wP7xX())!k%Z{fQi#sk z?mhsutso%v6bfDd!JikN+nka>AU-8qJTSS#1-ESe17>qTdX^n9G#}UPg$|W55ovJZ zP`158B21~f<++&s0ZD>t$%0@pI!#9~-?8jYjRn-_o^bsZsv1V0iL{LJWP2xeE8%#L zY)3H~##oRCMED^a^-hS-MCd#FDsBldOusr4N>=rF=aj{*FtUU)`$<-5PHm3u5Z1sm zCfcf6eEg8dnOD2rG||UMitRKs8R!G}O@j~Lf(=?ZQq~o9^o%f*mDN)cXkWleQW2B7p=^5)2UbbUCNyg_ z)1%l-`xaI$+ct3);H_jqTDU2d=fMr(jze4UBiHHiuIz47$1hoTgV7!CjUSK2BpJRbz+b9QB_63$4PXdl38a(aoyKu$%{St%|5l!Li6;XCjycf3%T zNeP3fhN>9_?JnHr4h}Ki9aE5uENJVn*0b-Q z@O(zOj9G<{*Op)gPp~VB3VCfA=6btkKwY1eq>sFI58g+kE~oe+m@cKEuP#-RiSnY| zhxNXXZSI;ly~M=?J;~*QMxc~|B}IvA0!jnjy@K?bQc)>k3*?kEJvTrmT_TkfHA}KV z1r4jNCjFRLc4$QG$m=^|J(q}uD=d4gCG%2T4qz?g-V=7o?4-ISSf(i}OeTBwQFc^Lg{s{=>^EC3vknWbxm3f)~|CAkE!UM{ZBWGP_RPJr!fza z2KWl`f!sq(U1QqU1Fb7UI5`;>u$s$&aPI z<_!nNB@k{Py_2=9TAHg9$7vC`| zg362dYgn;es-9UqOFoAclu{N1t{-Ve-y_Fo(HI?-n(=5Ijx3BQkEb2Zui@dJImyhy z8@hG4T8kIQD$icTR_>dJ(TkNl)cCgd-O)W2pL|?ZlhI>w?|gss&#(D%L#?N}T2J-V zOH)7F{XG$O;^j5nUaQRxuCFiicOqlMP}YW#nH$F0?)i**g+F0a5qti2wiq diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Geometry.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Geometry.php deleted file mode 100644 index 2780ed666e20..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Geometry.php +++ /dev/null @@ -1,36 +0,0 @@ -internalAddGeneratedFile( - ' - -)google/cloud/documentai/v1/geometry.protogoogle.cloud.documentai.v1" -Vertex -x ( -y ("( -NormalizedVertex -x ( -y (" - BoundingPoly4 -vertices ( 2".google.cloud.documentai.v1.VertexI -normalized_vertices ( 2,.google.cloud.documentai.v1.NormalizedVertexB -com.google.cloud.documentai.v1B GeometryProtoPZ>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipbGoogle.Cloud.DocumentAI.V1Google\\Cloud\\DocumentAI\\V1Google::Cloud::DocumentAI::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/OperationMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/OperationMetadata.php deleted file mode 100644 index 5152d9893a80987d5815419964ae6281b52ffedc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1280 zcmbVL(QeZ)6s6rdn5Ru65>QP7nK5ad1gW|`;jy7E%}S)vRQUp##quZ9DRZEnnDqC$q5hO zD4k4b3<(bf3utUZ*y_SgcL3d%H+ZR_2~T4}5u9>94QQPNJRR4^oTMR*Bxd!SMx6^y z&UiEosl;O}v2FMPh;T>~feD4}-r2|5qu(}EzN4x9Rzc-oHI4xw0ZtOw%_(yb_y(Z* zL^=u>fr(W42;5`IkVQ-~9I&sdxf3|SK|&SFa_l6Hh^`T8KsO?^b^tR@9lIyE65|Bs zwe_?j~I2 zOlkp>1W#$TtQgm=ZSW|j*#cK9=B5rdNK6%ED3x^86?M6BxRWO~TdSsS7rI&skP5ZZ zGr;P<0J{`a@|qs^2hD*yyzKOQuH&71ZfpC2wE-S}y6kkkPJ6p#Z2{mkJC1vCq0eP& z6Rh_y9mjQBDt5&JVC}r=U8w(6{WJ?z$I98S5_q9Zn^%5^^k+|(6gPX*D}6rA!gINK zSfBDmPh-K9t>=RjqvOTHkMd62SlBiewsQ+NJ^QNhGk^4F1}_}m^n7LUKjr5c7$Jj3 lXbwl{sxewKQ#jf$mh*Mymj!$2Su=8nwM=BT|F_^4fWNNpn%MvV diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Processor.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/Processor.php deleted file mode 100644 index d03f0e9f91701831a7bb57798030f0691a323952..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4080 zcmb_f&2HO95RPQaw#JSvvrZu^Ny|6^;{24V-J%EO50pi@Dq=~nWdUx4vNXA}x1mUa zq+BGad+MP;Z!M5(?|q7%d+QtYoJZ)Xv%4fE%Zh6w$-&Wbc4lY3oo{CL;S=xBgPZau zafok(#FF=4$l)Q8J>Lyo)3xROez!|}*>rmzwTZ9Da-|{H8!cI@)LJ)CHE{dBNlNm8 z>mJyoXxeVyDq61D?-3_7Xz^&Rh{jA31g@`evjC3KBY|g_MBZ$cw@7GMMrd?4xrNRK zv(Tv|7CP;<2LPsR1cBU)Ex{|0@t@b_GR@>bSyJRyYi~=u~a(c*hEas% zr%-i%ef=!eQCF26rpa8Kkcu#C`UICc3o<{=9Vx`tVg!^VOQf%0(Z=mTs1I<<&v3P3 ztTyI4l|hnj6D*MgYY4;Vc`wkPlL((In#oGnU@883B(N3e0heBdd4ZDNGaTc9SovA} zJ|m)OL(U?ePfX4RtZrR5f0_IC@GRd>0aO_nsi6(20nl?TV(Z}xkK`B7;{5s-7qYm; z)LW=694)}*0DTO)lmxo>GRWr!L5#>~esLgs28##8(G98#e|UrvkMO~T{6QA0lsm-& zACa+Tihyyd;H?H~T^8 z_QssdVw_!XzRSrQ-1g|Hg=dg|n@>^!q%L)^Av)AK&<)#mzekQR6lSEGaJ5GrJ@gIy zYa9E-CYBzb+o)A*S|xW$%EMAy+uo@)>RLswHg@Y3 zwS|jZN}30#*6Nzx+C@<=U7m}J03+SXZz;&|Ix1a(#hsSg8Z|rzGZn4*w6TZEDd{p~ z#i~}{%%z!aJSi4WNDD90fGJf(%~DGz|FWOpV1Pf#|Y#*kgNQ63O>Rnd&WhUKZu7;l_tsF zOnv=W%y;pyijDff9e%@N|HfzRAO>&$!SLdbbYYXfT^0VANhVvhrnJ}oiiMr%Wt+T| z)LIAMwr|qcg>tFHwM(VM$6Be>UfZ8SSVH%++sVV^zIZSWy)W6|OwBQGOTJUQ0FU7q F;6G$kE>!>k diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/ProcessorType.php b/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/ProcessorType.php deleted file mode 100644 index 65a61c15c025..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/GPBMetadata/Google/Cloud/Documentai/V1/ProcessorType.php +++ /dev/null @@ -1,40 +0,0 @@ -internalAddGeneratedFile( - ' - -/google/cloud/documentai/v1/processor_type.protogoogle.cloud.documentai.v1google/api/resource.proto" - ProcessorType -name (  -type (  -category ( S -available_locations ( 26.google.cloud.documentai.v1.ProcessorType.LocationInfo -allow_creation (- - launch_stage (2.google.api.LaunchStage -sample_document_uris ( # - LocationInfo - location_id ( :uAr -\'documentai.googleapis.com/ProcessorTypeGprojects/{project}/locations/{location}/processorTypes/{processor_type}B -com.google.cloud.documentai.v1BDocumentAiProcessorTypePZ>cloud.google.com/go/documentai/apiv1/documentaipb;documentaipbGoogle.Cloud.DocumentAI.V1Google\\Cloud\\DocumentAI\\V1Google::Cloud::DocumentAI::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Barcode.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Barcode.php deleted file mode 100644 index c07863d95b65..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Barcode.php +++ /dev/null @@ -1,255 +0,0 @@ -google.cloud.documentai.v1.Barcode - */ -class Barcode extends \Google\Protobuf\Internal\Message -{ - /** - * Format of a barcode. - * The supported formats are: - * - `CODE_128`: Code 128 type. - * - `CODE_39`: Code 39 type. - * - `CODE_93`: Code 93 type. - * - `CODABAR`: Codabar type. - * - `DATA_MATRIX`: 2D Data Matrix type. - * - `ITF`: ITF type. - * - `EAN_13`: EAN-13 type. - * - `EAN_8`: EAN-8 type. - * - `QR_CODE`: 2D QR code type. - * - `UPC_A`: UPC-A type. - * - `UPC_E`: UPC-E type. - * - `PDF417`: PDF417 type. - * - `AZTEC`: 2D Aztec code type. - * - `DATABAR`: GS1 DataBar code type. - * - * Generated from protobuf field string format = 1; - */ - protected $format = ''; - /** - * Value format describes the format of the value that a barcode - * encodes. - * The supported formats are: - * - `CONTACT_INFO`: Contact information. - * - `EMAIL`: Email address. - * - `ISBN`: ISBN identifier. - * - `PHONE`: Phone number. - * - `PRODUCT`: Product. - * - `SMS`: SMS message. - * - `TEXT`: Text string. - * - `URL`: URL address. - * - `WIFI`: Wifi information. - * - `GEO`: Geo-localization. - * - `CALENDAR_EVENT`: Calendar event. - * - `DRIVER_LICENSE`: Driver's license. - * - * Generated from protobuf field string value_format = 2; - */ - protected $value_format = ''; - /** - * Raw value encoded in the barcode. - * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - * - * Generated from protobuf field string raw_value = 3; - */ - protected $raw_value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $format - * Format of a barcode. - * The supported formats are: - * - `CODE_128`: Code 128 type. - * - `CODE_39`: Code 39 type. - * - `CODE_93`: Code 93 type. - * - `CODABAR`: Codabar type. - * - `DATA_MATRIX`: 2D Data Matrix type. - * - `ITF`: ITF type. - * - `EAN_13`: EAN-13 type. - * - `EAN_8`: EAN-8 type. - * - `QR_CODE`: 2D QR code type. - * - `UPC_A`: UPC-A type. - * - `UPC_E`: UPC-E type. - * - `PDF417`: PDF417 type. - * - `AZTEC`: 2D Aztec code type. - * - `DATABAR`: GS1 DataBar code type. - * @type string $value_format - * Value format describes the format of the value that a barcode - * encodes. - * The supported formats are: - * - `CONTACT_INFO`: Contact information. - * - `EMAIL`: Email address. - * - `ISBN`: ISBN identifier. - * - `PHONE`: Phone number. - * - `PRODUCT`: Product. - * - `SMS`: SMS message. - * - `TEXT`: Text string. - * - `URL`: URL address. - * - `WIFI`: Wifi information. - * - `GEO`: Geo-localization. - * - `CALENDAR_EVENT`: Calendar event. - * - `DRIVER_LICENSE`: Driver's license. - * @type string $raw_value - * Raw value encoded in the barcode. - * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Barcode::initOnce(); - parent::__construct($data); - } - - /** - * Format of a barcode. - * The supported formats are: - * - `CODE_128`: Code 128 type. - * - `CODE_39`: Code 39 type. - * - `CODE_93`: Code 93 type. - * - `CODABAR`: Codabar type. - * - `DATA_MATRIX`: 2D Data Matrix type. - * - `ITF`: ITF type. - * - `EAN_13`: EAN-13 type. - * - `EAN_8`: EAN-8 type. - * - `QR_CODE`: 2D QR code type. - * - `UPC_A`: UPC-A type. - * - `UPC_E`: UPC-E type. - * - `PDF417`: PDF417 type. - * - `AZTEC`: 2D Aztec code type. - * - `DATABAR`: GS1 DataBar code type. - * - * Generated from protobuf field string format = 1; - * @return string - */ - public function getFormat() - { - return $this->format; - } - - /** - * Format of a barcode. - * The supported formats are: - * - `CODE_128`: Code 128 type. - * - `CODE_39`: Code 39 type. - * - `CODE_93`: Code 93 type. - * - `CODABAR`: Codabar type. - * - `DATA_MATRIX`: 2D Data Matrix type. - * - `ITF`: ITF type. - * - `EAN_13`: EAN-13 type. - * - `EAN_8`: EAN-8 type. - * - `QR_CODE`: 2D QR code type. - * - `UPC_A`: UPC-A type. - * - `UPC_E`: UPC-E type. - * - `PDF417`: PDF417 type. - * - `AZTEC`: 2D Aztec code type. - * - `DATABAR`: GS1 DataBar code type. - * - * Generated from protobuf field string format = 1; - * @param string $var - * @return $this - */ - public function setFormat($var) - { - GPBUtil::checkString($var, True); - $this->format = $var; - - return $this; - } - - /** - * Value format describes the format of the value that a barcode - * encodes. - * The supported formats are: - * - `CONTACT_INFO`: Contact information. - * - `EMAIL`: Email address. - * - `ISBN`: ISBN identifier. - * - `PHONE`: Phone number. - * - `PRODUCT`: Product. - * - `SMS`: SMS message. - * - `TEXT`: Text string. - * - `URL`: URL address. - * - `WIFI`: Wifi information. - * - `GEO`: Geo-localization. - * - `CALENDAR_EVENT`: Calendar event. - * - `DRIVER_LICENSE`: Driver's license. - * - * Generated from protobuf field string value_format = 2; - * @return string - */ - public function getValueFormat() - { - return $this->value_format; - } - - /** - * Value format describes the format of the value that a barcode - * encodes. - * The supported formats are: - * - `CONTACT_INFO`: Contact information. - * - `EMAIL`: Email address. - * - `ISBN`: ISBN identifier. - * - `PHONE`: Phone number. - * - `PRODUCT`: Product. - * - `SMS`: SMS message. - * - `TEXT`: Text string. - * - `URL`: URL address. - * - `WIFI`: Wifi information. - * - `GEO`: Geo-localization. - * - `CALENDAR_EVENT`: Calendar event. - * - `DRIVER_LICENSE`: Driver's license. - * - * Generated from protobuf field string value_format = 2; - * @param string $var - * @return $this - */ - public function setValueFormat($var) - { - GPBUtil::checkString($var, True); - $this->value_format = $var; - - return $this; - } - - /** - * Raw value encoded in the barcode. - * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - * - * Generated from protobuf field string raw_value = 3; - * @return string - */ - public function getRawValue() - { - return $this->raw_value; - } - - /** - * Raw value encoded in the barcode. - * For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. - * - * Generated from protobuf field string raw_value = 3; - * @param string $var - * @return $this - */ - public function setRawValue($var) - { - GPBUtil::checkString($var, True); - $this->raw_value = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchDocumentsInputConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchDocumentsInputConfig.php deleted file mode 100644 index 087665129f05..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchDocumentsInputConfig.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.documentai.v1.BatchDocumentsInputConfig - */ -class BatchDocumentsInputConfig extends \Google\Protobuf\Internal\Message -{ - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\GcsPrefix $gcs_prefix - * The set of documents that match the specified Cloud Storage `gcs_prefix`. - * @type \Google\Cloud\DocumentAI\V1\GcsDocuments $gcs_documents - * The set of documents individually specified on Cloud Storage. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * The set of documents that match the specified Cloud Storage `gcs_prefix`. - * - * Generated from protobuf field .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; - * @return \Google\Cloud\DocumentAI\V1\GcsPrefix|null - */ - public function getGcsPrefix() - { - return $this->readOneof(1); - } - - public function hasGcsPrefix() - { - return $this->hasOneof(1); - } - - /** - * The set of documents that match the specified Cloud Storage `gcs_prefix`. - * - * Generated from protobuf field .google.cloud.documentai.v1.GcsPrefix gcs_prefix = 1; - * @param \Google\Cloud\DocumentAI\V1\GcsPrefix $var - * @return $this - */ - public function setGcsPrefix($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\GcsPrefix::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The set of documents individually specified on Cloud Storage. - * - * Generated from protobuf field .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; - * @return \Google\Cloud\DocumentAI\V1\GcsDocuments|null - */ - public function getGcsDocuments() - { - return $this->readOneof(2); - } - - public function hasGcsDocuments() - { - return $this->hasOneof(2); - } - - /** - * The set of documents individually specified on Cloud Storage. - * - * Generated from protobuf field .google.cloud.documentai.v1.GcsDocuments gcs_documents = 2; - * @param \Google\Cloud\DocumentAI\V1\GcsDocuments $var - * @return $this - */ - public function setGcsDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\GcsDocuments::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata.php deleted file mode 100644 index acda6f101347..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata.php +++ /dev/null @@ -1,228 +0,0 @@ -google.cloud.documentai.v1.BatchProcessMetadata - */ -class BatchProcessMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The state of the current batch processing. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; - */ - protected $state = 0; - /** - * A message providing more details about the current state of processing. - * For example, the error message if the operation is failed. - * - * Generated from protobuf field string state_message = 2; - */ - protected $state_message = ''; - /** - * The creation time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - */ - protected $create_time = null; - /** - * The last update time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - */ - protected $update_time = null; - /** - * The list of response details of each document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; - */ - private $individual_process_statuses; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The state of the current batch processing. - * @type string $state_message - * A message providing more details about the current state of processing. - * For example, the error message if the operation is failed. - * @type \Google\Protobuf\Timestamp $create_time - * The creation time of the operation. - * @type \Google\Protobuf\Timestamp $update_time - * The last update time of the operation. - * @type array<\Google\Cloud\DocumentAI\V1\BatchProcessMetadata\IndividualProcessStatus>|\Google\Protobuf\Internal\RepeatedField $individual_process_statuses - * The list of response details of each document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The state of the current batch processing. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The state of the current batch processing. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchProcessMetadata.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\BatchProcessMetadata\State::class); - $this->state = $var; - - return $this; - } - - /** - * A message providing more details about the current state of processing. - * For example, the error message if the operation is failed. - * - * Generated from protobuf field string state_message = 2; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * A message providing more details about the current state of processing. - * For example, the error message if the operation is failed. - * - * Generated from protobuf field string state_message = 2; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * The creation time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The creation time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The last update time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The last update time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * The list of response details of each document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIndividualProcessStatuses() - { - return $this->individual_process_statuses; - } - - /** - * The list of response details of each document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus individual_process_statuses = 5; - * @param array<\Google\Cloud\DocumentAI\V1\BatchProcessMetadata\IndividualProcessStatus>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIndividualProcessStatuses($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\BatchProcessMetadata\IndividualProcessStatus::class); - $this->individual_process_statuses = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/IndividualProcessStatus.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/IndividualProcessStatus.php deleted file mode 100644 index 9b8d8d2c539b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/IndividualProcessStatus.php +++ /dev/null @@ -1,208 +0,0 @@ -google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - */ -class IndividualProcessStatus extends \Google\Protobuf\Internal\Message -{ - /** - * The source of the document, same as the - * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] - * field in the request when the batch process started. - * - * Generated from protobuf field string input_gcs_source = 1; - */ - protected $input_gcs_source = ''; - /** - * The status processing the document. - * - * Generated from protobuf field .google.rpc.Status status = 2; - */ - protected $status = null; - /** - * The Cloud Storage output destination (in the request as - * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) - * of the processed document if it was successful, otherwise empty. - * - * Generated from protobuf field string output_gcs_destination = 3; - */ - protected $output_gcs_destination = ''; - /** - * The status of human review on the processed document. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; - */ - protected $human_review_status = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $input_gcs_source - * The source of the document, same as the - * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] - * field in the request when the batch process started. - * @type \Google\Rpc\Status $status - * The status processing the document. - * @type string $output_gcs_destination - * The Cloud Storage output destination (in the request as - * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) - * of the processed document if it was successful, otherwise empty. - * @type \Google\Cloud\DocumentAI\V1\HumanReviewStatus $human_review_status - * The status of human review on the processed document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The source of the document, same as the - * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] - * field in the request when the batch process started. - * - * Generated from protobuf field string input_gcs_source = 1; - * @return string - */ - public function getInputGcsSource() - { - return $this->input_gcs_source; - } - - /** - * The source of the document, same as the - * [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source] - * field in the request when the batch process started. - * - * Generated from protobuf field string input_gcs_source = 1; - * @param string $var - * @return $this - */ - public function setInputGcsSource($var) - { - GPBUtil::checkString($var, True); - $this->input_gcs_source = $var; - - return $this; - } - - /** - * The status processing the document. - * - * Generated from protobuf field .google.rpc.Status status = 2; - * @return \Google\Rpc\Status|null - */ - public function getStatus() - { - return $this->status; - } - - public function hasStatus() - { - return isset($this->status); - } - - public function clearStatus() - { - unset($this->status); - } - - /** - * The status processing the document. - * - * Generated from protobuf field .google.rpc.Status status = 2; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->status = $var; - - return $this; - } - - /** - * The Cloud Storage output destination (in the request as - * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) - * of the processed document if it was successful, otherwise empty. - * - * Generated from protobuf field string output_gcs_destination = 3; - * @return string - */ - public function getOutputGcsDestination() - { - return $this->output_gcs_destination; - } - - /** - * The Cloud Storage output destination (in the request as - * [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) - * of the processed document if it was successful, otherwise empty. - * - * Generated from protobuf field string output_gcs_destination = 3; - * @param string $var - * @return $this - */ - public function setOutputGcsDestination($var) - { - GPBUtil::checkString($var, True); - $this->output_gcs_destination = $var; - - return $this; - } - - /** - * The status of human review on the processed document. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; - * @return \Google\Cloud\DocumentAI\V1\HumanReviewStatus|null - */ - public function getHumanReviewStatus() - { - return $this->human_review_status; - } - - public function hasHumanReviewStatus() - { - return isset($this->human_review_status); - } - - public function clearHumanReviewStatus() - { - unset($this->human_review_status); - } - - /** - * The status of human review on the processed document. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 5; - * @param \Google\Cloud\DocumentAI\V1\HumanReviewStatus $var - * @return $this - */ - public function setHumanReviewStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\HumanReviewStatus::class); - $this->human_review_status = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IndividualProcessStatus::class, \Google\Cloud\DocumentAI\V1\BatchProcessMetadata_IndividualProcessStatus::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/State.php deleted file mode 100644 index 2271791e75f1..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessMetadata/State.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.documentai.v1.BatchProcessMetadata.State - */ -class State -{ - /** - * The default value. This value is used if the state is omitted. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Request operation is waiting for scheduling. - * - * Generated from protobuf enum WAITING = 1; - */ - const WAITING = 1; - /** - * Request is being processed. - * - * Generated from protobuf enum RUNNING = 2; - */ - const RUNNING = 2; - /** - * The batch processing completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 3; - */ - const SUCCEEDED = 3; - /** - * The batch processing was being cancelled. - * - * Generated from protobuf enum CANCELLING = 4; - */ - const CANCELLING = 4; - /** - * The batch processing was cancelled. - * - * Generated from protobuf enum CANCELLED = 5; - */ - const CANCELLED = 5; - /** - * The batch processing has failed. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::WAITING => 'WAITING', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::CANCELLING => 'CANCELLING', - self::CANCELLED => 'CANCELLED', - self::FAILED => 'FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\DocumentAI\V1\BatchProcessMetadata_State::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessRequest.php deleted file mode 100644 index 51031e244a22..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessRequest.php +++ /dev/null @@ -1,342 +0,0 @@ -google.cloud.documentai.v1.BatchProcessRequest - */ -class BatchProcessRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The input documents for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; - */ - protected $input_documents = null; - /** - * The output configuration for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; - */ - protected $document_output_config = null; - /** - * Whether human review should be skipped for this request. Default to - * `false`. - * - * Generated from protobuf field bool skip_human_review = 4; - */ - protected $skip_human_review = false; - /** - * Inference-time options for the process API - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; - */ - protected $process_options = null; - /** - * Optional. The labels with user-defined metadata for the request. - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - - /** - * @param string $name Required. The resource name of - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * @return \Google\Cloud\DocumentAI\V1\BatchProcessRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $input_documents - * The input documents for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * @type \Google\Cloud\DocumentAI\V1\DocumentOutputConfig $document_output_config - * The output configuration for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * @type bool $skip_human_review - * Whether human review should be skipped for this request. Default to - * `false`. - * @type \Google\Cloud\DocumentAI\V1\ProcessOptions $process_options - * Inference-time options for the process API - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. The labels with user-defined metadata for the request. - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The input documents for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; - * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null - */ - public function getInputDocuments() - { - return $this->input_documents; - } - - public function hasInputDocuments() - { - return isset($this->input_documents); - } - - public function clearInputDocuments() - { - unset($this->input_documents); - } - - /** - * The input documents for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig input_documents = 5; - * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var - * @return $this - */ - public function setInputDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig::class); - $this->input_documents = $var; - - return $this; - } - - /** - * The output configuration for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; - * @return \Google\Cloud\DocumentAI\V1\DocumentOutputConfig|null - */ - public function getDocumentOutputConfig() - { - return $this->document_output_config; - } - - public function hasDocumentOutputConfig() - { - return isset($this->document_output_config); - } - - public function clearDocumentOutputConfig() - { - unset($this->document_output_config); - } - - /** - * The output configuration for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig document_output_config = 6; - * @param \Google\Cloud\DocumentAI\V1\DocumentOutputConfig $var - * @return $this - */ - public function setDocumentOutputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig::class); - $this->document_output_config = $var; - - return $this; - } - - /** - * Whether human review should be skipped for this request. Default to - * `false`. - * - * Generated from protobuf field bool skip_human_review = 4; - * @return bool - */ - public function getSkipHumanReview() - { - return $this->skip_human_review; - } - - /** - * Whether human review should be skipped for this request. Default to - * `false`. - * - * Generated from protobuf field bool skip_human_review = 4; - * @param bool $var - * @return $this - */ - public function setSkipHumanReview($var) - { - GPBUtil::checkBool($var); - $this->skip_human_review = $var; - - return $this; - } - - /** - * Inference-time options for the process API - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; - * @return \Google\Cloud\DocumentAI\V1\ProcessOptions|null - */ - public function getProcessOptions() - { - return $this->process_options; - } - - public function hasProcessOptions() - { - return isset($this->process_options); - } - - public function clearProcessOptions() - { - unset($this->process_options); - } - - /** - * Inference-time options for the process API - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; - * @param \Google\Cloud\DocumentAI\V1\ProcessOptions $var - * @return $this - */ - public function setProcessOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions::class); - $this->process_options = $var; - - return $this; - } - - /** - * Optional. The labels with user-defined metadata for the request. - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. The labels with user-defined metadata for the request. - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessResponse.php deleted file mode 100644 index 57562ab5f73f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BatchProcessResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.cloud.documentai.v1.BatchProcessResponse - */ -class BatchProcessResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BoundingPoly.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BoundingPoly.php deleted file mode 100644 index 90a2873a1327..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/BoundingPoly.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.documentai.v1.BoundingPoly - */ -class BoundingPoly extends \Google\Protobuf\Internal\Message -{ - /** - * The bounding polygon vertices. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Vertex vertices = 1; - */ - private $vertices; - /** - * The bounding polygon normalized vertices. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; - */ - private $normalized_vertices; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Vertex>|\Google\Protobuf\Internal\RepeatedField $vertices - * The bounding polygon vertices. - * @type array<\Google\Cloud\DocumentAI\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $normalized_vertices - * The bounding polygon normalized vertices. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Geometry::initOnce(); - parent::__construct($data); - } - - /** - * The bounding polygon vertices. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Vertex vertices = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVertices() - { - return $this->vertices; - } - - /** - * The bounding polygon vertices. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Vertex vertices = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Vertex>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVertices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Vertex::class); - $this->vertices = $arr; - - return $this; - } - - /** - * The bounding polygon normalized vertices. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNormalizedVertices() - { - return $this->normalized_vertices; - } - - /** - * The bounding polygon normalized vertices. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.NormalizedVertex normalized_vertices = 2; - * @param array<\Google\Cloud\DocumentAI\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNormalizedVertices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\NormalizedVertex::class); - $this->normalized_vertices = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata.php deleted file mode 100644 index e5406876c1ca..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata.php +++ /dev/null @@ -1,223 +0,0 @@ -google.cloud.documentai.v1.CommonOperationMetadata - */ -class CommonOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The state of the operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; - */ - protected $state = 0; - /** - * A message providing more details about the current state of processing. - * - * Generated from protobuf field string state_message = 2; - */ - protected $state_message = ''; - /** - * A related resource to this operation. - * - * Generated from protobuf field string resource = 5; - */ - protected $resource = ''; - /** - * The creation time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - */ - protected $create_time = null; - /** - * The last update time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - */ - protected $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The state of the operation. - * @type string $state_message - * A message providing more details about the current state of processing. - * @type string $resource - * A related resource to this operation. - * @type \Google\Protobuf\Timestamp $create_time - * The creation time of the operation. - * @type \Google\Protobuf\Timestamp $update_time - * The last update time of the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\OperationMetadata::initOnce(); - parent::__construct($data); - } - - /** - * The state of the operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The state of the operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata\State::class); - $this->state = $var; - - return $this; - } - - /** - * A message providing more details about the current state of processing. - * - * Generated from protobuf field string state_message = 2; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * A message providing more details about the current state of processing. - * - * Generated from protobuf field string state_message = 2; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * A related resource to this operation. - * - * Generated from protobuf field string resource = 5; - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * A related resource to this operation. - * - * Generated from protobuf field string resource = 5; - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * The creation time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The creation time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The last update time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The last update time of the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata/State.php deleted file mode 100644 index 59ee91f8b60e..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CommonOperationMetadata/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.documentai.v1.CommonOperationMetadata.State - */ -class State -{ - /** - * Unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Operation is still running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * Operation is being cancelled. - * - * Generated from protobuf enum CANCELLING = 2; - */ - const CANCELLING = 2; - /** - * Operation succeeded. - * - * Generated from protobuf enum SUCCEEDED = 3; - */ - const SUCCEEDED = 3; - /** - * Operation failed. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * Operation is cancelled. - * - * Generated from protobuf enum CANCELLED = 5; - */ - const CANCELLED = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::CANCELLING => 'CANCELLING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata_State::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CreateProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CreateProcessorRequest.php deleted file mode 100644 index 64faa44770ca..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/CreateProcessorRequest.php +++ /dev/null @@ -1,161 +0,0 @@ -google.cloud.documentai.v1.CreateProcessorRequest - */ -class CreateProcessorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The processor to be created, requires - * [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] - * to be set. Also, the - * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] - * field must be set if the processor is under CMEK. - * - * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $processor = null; - - /** - * @param string $parent Required. The parent (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - * Please see {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. - * @param \Google\Cloud\DocumentAI\V1\Processor $processor Required. The processor to be created, requires - * [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] - * to be set. Also, the - * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] - * field must be set if the processor is under CMEK. - * - * @return \Google\Cloud\DocumentAI\V1\CreateProcessorRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\DocumentAI\V1\Processor $processor): self - { - return (new self()) - ->setParent($parent) - ->setProcessor($processor); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - * @type \Google\Cloud\DocumentAI\V1\Processor $processor - * Required. The processor to be created, requires - * [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] - * to be set. Also, the - * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] - * field must be set if the processor is under CMEK. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The processor to be created, requires - * [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] - * to be set. Also, the - * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] - * field must be set if the processor is under CMEK. - * - * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DocumentAI\V1\Processor|null - */ - public function getProcessor() - { - return $this->processor; - } - - public function hasProcessor() - { - return isset($this->processor); - } - - public function clearProcessor() - { - unset($this->processor); - } - - /** - * Required. The processor to be created, requires - * [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] - * to be set. Also, the - * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] - * field must be set if the processor is under CMEK. - * - * Generated from protobuf field .google.cloud.documentai.v1.Processor processor = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DocumentAI\V1\Processor $var - * @return $this - */ - public function setProcessor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Processor::class); - $this->processor = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorMetadata.php deleted file mode 100644 index 80124ed069c0..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorMetadata.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.documentai.v1.DeleteProcessorMetadata - */ -class DeleteProcessorMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - */ - protected $common_metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorRequest.php deleted file mode 100644 index 6cb572b012b4..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.documentai.v1.DeleteProcessorRequest - */ -class DeleteProcessorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor resource name to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The processor resource name to be deleted. Please see - * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\DeleteProcessorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor resource name to be deleted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor resource name to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor resource name to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionMetadata.php deleted file mode 100644 index 4327a21261df..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionMetadata.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.documentai.v1.DeleteProcessorVersionMetadata - */ -class DeleteProcessorVersionMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - */ - protected $common_metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionRequest.php deleted file mode 100644 index c1b9fe66983a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeleteProcessorVersionRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.documentai.v1.DeleteProcessorVersionRequest - */ -class DeleteProcessorVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor version resource name to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The processor version resource name to be deleted. Please see - * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\DeleteProcessorVersionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor version resource name to be deleted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor version resource name to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor version resource name to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionMetadata.php deleted file mode 100644 index 58dbc80516ee..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionMetadata.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.documentai.v1.DeployProcessorVersionMetadata - */ -class DeployProcessorVersionMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - */ - protected $common_metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionRequest.php deleted file mode 100644 index 38bd51702394..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.documentai.v1.DeployProcessorVersionRequest - */ -class DeployProcessorVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor version resource name to be deployed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The processor version resource name to be deployed. Please see - * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\DeployProcessorVersionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor version resource name to be deployed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor version resource name to be deployed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor version resource name to be deployed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionResponse.php deleted file mode 100644 index f44a4454de41..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DeployProcessorVersionResponse.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.documentai.v1.DeployProcessorVersionResponse - */ -class DeployProcessorVersionResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorMetadata.php deleted file mode 100644 index dbecdbea0c9e..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorMetadata.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.documentai.v1.DisableProcessorMetadata - */ -class DisableProcessorMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - */ - protected $common_metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorRequest.php deleted file mode 100644 index fcefe5486fe9..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorRequest.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.documentai.v1.DisableProcessorRequest - */ -class DisableProcessorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor resource name to be disabled. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor resource name to be disabled. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor resource name to be disabled. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor resource name to be disabled. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorResponse.php deleted file mode 100644 index f1f15d776735..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DisableProcessorResponse.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.documentai.v1.DisableProcessorResponse - */ -class DisableProcessorResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document.php deleted file mode 100644 index 7dc35121eda2..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document.php +++ /dev/null @@ -1,611 +0,0 @@ -google.cloud.documentai.v1.Document - */ -class Document extends \Google\Protobuf\Internal\Message -{ - /** - * An IANA published [media type (MIME - * type)](https://www.iana.org/assignments/media-types/media-types.xhtml). - * - * Generated from protobuf field string mime_type = 3; - */ - protected $mime_type = ''; - /** - * Optional. UTF-8 encoded text in reading order from the document. - * - * Generated from protobuf field string text = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $text = ''; - /** - * Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true]; - * @deprecated - */ - private $text_styles; - /** - * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page pages = 6; - */ - private $pages; - /** - * A list of entities detected on - * [Document.text][google.cloud.documentai.v1.Document.text]. For document - * shards, entities in this list may cross shard boundaries. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; - */ - private $entities; - /** - * Placeholder. Relationship among - * [Document.entities][google.cloud.documentai.v1.Document.entities]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; - */ - private $entity_relations; - /** - * Placeholder. A list of text corrections made to - * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually - * used for annotating corrections to OCR mistakes. Text changes for a given - * revision may not overlap with each other. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; - */ - private $text_changes; - /** - * Information about the sharding if this document is sharded part of a larger - * document. If the document is not sharded, this message is not specified. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ShardInfo shard_info = 9; - */ - protected $shard_info = null; - /** - * Any error that occurred while processing this document. - * - * Generated from protobuf field .google.rpc.Status error = 10; - */ - protected $error = null; - /** - * Placeholder. Revision history of this document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; - */ - private $revisions; - /** - * Parsed layout of the document. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; - */ - protected $document_layout = null; - /** - * Document chunked based on chunking config. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; - */ - protected $chunked_document = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Optional. Currently supports Google Cloud Storage URI of the form - * `gs://bucket_name/object_name`. Object versioning is not supported. - * For more information, refer to [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris). - * @type string $content - * Optional. Inline document content, represented as a stream of bytes. - * Note: As with all `bytes` fields, protobuffers use a pure binary - * representation, whereas JSON representations use base64. - * @type string $mime_type - * An IANA published [media type (MIME - * type)](https://www.iana.org/assignments/media-types/media-types.xhtml). - * @type string $text - * Optional. UTF-8 encoded text in reading order from the document. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Style>|\Google\Protobuf\Internal\RepeatedField $text_styles - * Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page>|\Google\Protobuf\Internal\RepeatedField $pages - * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $entities - * A list of entities detected on - * [Document.text][google.cloud.documentai.v1.Document.text]. For document - * shards, entities in this list may cross shard boundaries. - * @type array<\Google\Cloud\DocumentAI\V1\Document\EntityRelation>|\Google\Protobuf\Internal\RepeatedField $entity_relations - * Placeholder. Relationship among - * [Document.entities][google.cloud.documentai.v1.Document.entities]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\TextChange>|\Google\Protobuf\Internal\RepeatedField $text_changes - * Placeholder. A list of text corrections made to - * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually - * used for annotating corrections to OCR mistakes. Text changes for a given - * revision may not overlap with each other. - * @type \Google\Cloud\DocumentAI\V1\Document\ShardInfo $shard_info - * Information about the sharding if this document is sharded part of a larger - * document. If the document is not sharded, this message is not specified. - * @type \Google\Rpc\Status $error - * Any error that occurred while processing this document. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Revision>|\Google\Protobuf\Internal\RepeatedField $revisions - * Placeholder. Revision history of this document. - * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout $document_layout - * Parsed layout of the document. - * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument $chunked_document - * Document chunked based on chunking config. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Currently supports Google Cloud Storage URI of the form - * `gs://bucket_name/object_name`. Object versioning is not supported. - * For more information, refer to [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris). - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUri() - { - return $this->readOneof(1); - } - - public function hasUri() - { - return $this->hasOneof(1); - } - - /** - * Optional. Currently supports Google Cloud Storage URI of the form - * `gs://bucket_name/object_name`. Object versioning is not supported. - * For more information, refer to [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris). - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Optional. Inline document content, represented as a stream of bytes. - * Note: As with all `bytes` fields, protobuffers use a pure binary - * representation, whereas JSON representations use base64. - * - * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getContent() - { - return $this->readOneof(2); - } - - public function hasContent() - { - return $this->hasOneof(2); - } - - /** - * Optional. Inline document content, represented as a stream of bytes. - * Note: As with all `bytes` fields, protobuffers use a pure binary - * representation, whereas JSON representations use base64. - * - * Generated from protobuf field bytes content = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * An IANA published [media type (MIME - * type)](https://www.iana.org/assignments/media-types/media-types.xhtml). - * - * Generated from protobuf field string mime_type = 3; - * @return string - */ - public function getMimeType() - { - return $this->mime_type; - } - - /** - * An IANA published [media type (MIME - * type)](https://www.iana.org/assignments/media-types/media-types.xhtml). - * - * Generated from protobuf field string mime_type = 3; - * @param string $var - * @return $this - */ - public function setMimeType($var) - { - GPBUtil::checkString($var, True); - $this->mime_type = $var; - - return $this; - } - - /** - * Optional. UTF-8 encoded text in reading order from the document. - * - * Generated from protobuf field string text = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Optional. UTF-8 encoded text in reading order from the document. - * - * Generated from protobuf field string text = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getTextStyles() - { - @trigger_error('text_styles is deprecated.', E_USER_DEPRECATED); - return $this->text_styles; - } - - /** - * Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true]; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Style>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setTextStyles($var) - { - @trigger_error('text_styles is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Style::class); - $this->text_styles = $arr; - - return $this; - } - - /** - * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page pages = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPages() - { - return $this->pages; - } - - /** - * Visual page layout for the [Document][google.cloud.documentai.v1.Document]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page pages = 6; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page::class); - $this->pages = $arr; - - return $this; - } - - /** - * A list of entities detected on - * [Document.text][google.cloud.documentai.v1.Document.text]. For document - * shards, entities in this list may cross shard boundaries. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntities() - { - return $this->entities; - } - - /** - * A list of entities detected on - * [Document.text][google.cloud.documentai.v1.Document.text]. For document - * shards, entities in this list may cross shard boundaries. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity entities = 7; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntities($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Entity::class); - $this->entities = $arr; - - return $this; - } - - /** - * Placeholder. Relationship among - * [Document.entities][google.cloud.documentai.v1.Document.entities]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntityRelations() - { - return $this->entity_relations; - } - - /** - * Placeholder. Relationship among - * [Document.entities][google.cloud.documentai.v1.Document.entities]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8; - * @param array<\Google\Cloud\DocumentAI\V1\Document\EntityRelation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntityRelations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\EntityRelation::class); - $this->entity_relations = $arr; - - return $this; - } - - /** - * Placeholder. A list of text corrections made to - * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually - * used for annotating corrections to OCR mistakes. Text changes for a given - * revision may not overlap with each other. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTextChanges() - { - return $this->text_changes; - } - - /** - * Placeholder. A list of text corrections made to - * [Document.text][google.cloud.documentai.v1.Document.text]. This is usually - * used for annotating corrections to OCR mistakes. Text changes for a given - * revision may not overlap with each other. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14; - * @param array<\Google\Cloud\DocumentAI\V1\Document\TextChange>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTextChanges($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\TextChange::class); - $this->text_changes = $arr; - - return $this; - } - - /** - * Information about the sharding if this document is sharded part of a larger - * document. If the document is not sharded, this message is not specified. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ShardInfo shard_info = 9; - * @return \Google\Cloud\DocumentAI\V1\Document\ShardInfo|null - */ - public function getShardInfo() - { - return $this->shard_info; - } - - public function hasShardInfo() - { - return isset($this->shard_info); - } - - public function clearShardInfo() - { - unset($this->shard_info); - } - - /** - * Information about the sharding if this document is sharded part of a larger - * document. If the document is not sharded, this message is not specified. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ShardInfo shard_info = 9; - * @param \Google\Cloud\DocumentAI\V1\Document\ShardInfo $var - * @return $this - */ - public function setShardInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ShardInfo::class); - $this->shard_info = $var; - - return $this; - } - - /** - * Any error that occurred while processing this document. - * - * Generated from protobuf field .google.rpc.Status error = 10; - * @return \Google\Rpc\Status|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * Any error that occurred while processing this document. - * - * Generated from protobuf field .google.rpc.Status error = 10; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->error = $var; - - return $this; - } - - /** - * Placeholder. Revision history of this document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRevisions() - { - return $this->revisions; - } - - /** - * Placeholder. Revision history of this document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Revision revisions = 13; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Revision>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRevisions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Revision::class); - $this->revisions = $arr; - - return $this; - } - - /** - * Parsed layout of the document. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; - * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout|null - */ - public function getDocumentLayout() - { - return $this->document_layout; - } - - public function hasDocumentLayout() - { - return isset($this->document_layout); - } - - public function clearDocumentLayout() - { - unset($this->document_layout); - } - - /** - * Parsed layout of the document. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17; - * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout $var - * @return $this - */ - public function setDocumentLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout::class); - $this->document_layout = $var; - - return $this; - } - - /** - * Document chunked based on chunking config. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; - * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument|null - */ - public function getChunkedDocument() - { - return $this->chunked_document; - } - - public function hasChunkedDocument() - { - return isset($this->chunked_document); - } - - public function clearChunkedDocument() - { - unset($this->chunked_document); - } - - /** - * Document chunked based on chunking config. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18; - * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument $var - * @return $this - */ - public function setChunkedDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument::class); - $this->chunked_document = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument.php deleted file mode 100644 index a99c77df458d..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.documentai.v1.Document.ChunkedDocument - */ -class ChunkedDocument extends \Google\Protobuf\Internal\Message -{ - /** - * List of chunks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; - */ - private $chunks; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk>|\Google\Protobuf\Internal\RepeatedField $chunks - * List of chunks. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * List of chunks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getChunks() - { - return $this->chunks; - } - - /** - * List of chunks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk chunks = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setChunks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk::class); - $this->chunks = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ChunkedDocument::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk.php deleted file mode 100644 index e94f373bcc29..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk.php +++ /dev/null @@ -1,250 +0,0 @@ -google.cloud.documentai.v1.Document.ChunkedDocument.Chunk - */ -class Chunk extends \Google\Protobuf\Internal\Message -{ - /** - * ID of the chunk. - * - * Generated from protobuf field string chunk_id = 1; - */ - protected $chunk_id = ''; - /** - * Unused. - * - * Generated from protobuf field repeated string source_block_ids = 2; - */ - private $source_block_ids; - /** - * Text content of the chunk. - * - * Generated from protobuf field string content = 3; - */ - protected $content = ''; - /** - * Page span of the chunk. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; - */ - protected $page_span = null; - /** - * Page headers associated with the chunk. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; - */ - private $page_headers; - /** - * Page footers associated with the chunk. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; - */ - private $page_footers; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $chunk_id - * ID of the chunk. - * @type array|\Google\Protobuf\Internal\RepeatedField $source_block_ids - * Unused. - * @type string $content - * Text content of the chunk. - * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span - * Page span of the chunk. - * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader>|\Google\Protobuf\Internal\RepeatedField $page_headers - * Page headers associated with the chunk. - * @type array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter>|\Google\Protobuf\Internal\RepeatedField $page_footers - * Page footers associated with the chunk. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * ID of the chunk. - * - * Generated from protobuf field string chunk_id = 1; - * @return string - */ - public function getChunkId() - { - return $this->chunk_id; - } - - /** - * ID of the chunk. - * - * Generated from protobuf field string chunk_id = 1; - * @param string $var - * @return $this - */ - public function setChunkId($var) - { - GPBUtil::checkString($var, True); - $this->chunk_id = $var; - - return $this; - } - - /** - * Unused. - * - * Generated from protobuf field repeated string source_block_ids = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSourceBlockIds() - { - return $this->source_block_ids; - } - - /** - * Unused. - * - * Generated from protobuf field repeated string source_block_ids = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSourceBlockIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->source_block_ids = $arr; - - return $this; - } - - /** - * Text content of the chunk. - * - * Generated from protobuf field string content = 3; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Text content of the chunk. - * - * Generated from protobuf field string content = 3; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, True); - $this->content = $var; - - return $this; - } - - /** - * Page span of the chunk. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; - * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null - */ - public function getPageSpan() - { - return $this->page_span; - } - - public function hasPageSpan() - { - return isset($this->page_span); - } - - public function clearPageSpan() - { - unset($this->page_span); - } - - /** - * Page span of the chunk. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 4; - * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var - * @return $this - */ - public function setPageSpan($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); - $this->page_span = $var; - - return $this; - } - - /** - * Page headers associated with the chunk. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPageHeaders() - { - return $this->page_headers; - } - - /** - * Page headers associated with the chunk. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader page_headers = 5; - * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPageHeaders($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageHeader::class); - $this->page_headers = $arr; - - return $this; - } - - /** - * Page footers associated with the chunk. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPageFooters() - { - return $this->page_footers; - } - - /** - * Page footers associated with the chunk. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter page_footers = 6; - * @param array<\Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPageFooters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageFooter::class); - $this->page_footers = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Chunk::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument_Chunk::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php deleted file mode 100644 index 45bcf4550676..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageFooter.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter - */ -class ChunkPageFooter extends \Google\Protobuf\Internal\Message -{ - /** - * Footer in text format. - * - * Generated from protobuf field string text = 1; - */ - protected $text = ''; - /** - * Page span of the footer. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; - */ - protected $page_span = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * Footer in text format. - * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span - * Page span of the footer. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Footer in text format. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Footer in text format. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * Page span of the footer. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; - * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null - */ - public function getPageSpan() - { - return $this->page_span; - } - - public function hasPageSpan() - { - return isset($this->page_span); - } - - public function clearPageSpan() - { - unset($this->page_span); - } - - /** - * Page span of the footer. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; - * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var - * @return $this - */ - public function setPageSpan($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); - $this->page_span = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ChunkPageFooter::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument_Chunk_ChunkPageFooter::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php deleted file mode 100644 index b6020d329863..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageHeader.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader - */ -class ChunkPageHeader extends \Google\Protobuf\Internal\Message -{ - /** - * Header in text format. - * - * Generated from protobuf field string text = 1; - */ - protected $text = ''; - /** - * Page span of the header. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; - */ - protected $page_span = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * Header in text format. - * @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $page_span - * Page span of the header. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Header in text format. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Header in text format. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * Page span of the header. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; - * @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan|null - */ - public function getPageSpan() - { - return $this->page_span; - } - - public function hasPageSpan() - { - return isset($this->page_span); - } - - public function clearPageSpan() - { - unset($this->page_span); - } - - /** - * Page span of the header. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan page_span = 2; - * @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan $var - * @return $this - */ - public function setPageSpan($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument\Chunk\ChunkPageSpan::class); - $this->page_span = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ChunkPageHeader::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument_Chunk_ChunkPageHeader::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php deleted file mode 100644 index 42705efd01b5..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ChunkedDocument/Chunk/ChunkPageSpan.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan - */ -class ChunkPageSpan extends \Google\Protobuf\Internal\Message -{ - /** - * Page where chunk starts in the document. - * - * Generated from protobuf field int32 page_start = 1; - */ - protected $page_start = 0; - /** - * Page where chunk ends in the document. - * - * Generated from protobuf field int32 page_end = 2; - */ - protected $page_end = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $page_start - * Page where chunk starts in the document. - * @type int $page_end - * Page where chunk ends in the document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Page where chunk starts in the document. - * - * Generated from protobuf field int32 page_start = 1; - * @return int - */ - public function getPageStart() - { - return $this->page_start; - } - - /** - * Page where chunk starts in the document. - * - * Generated from protobuf field int32 page_start = 1; - * @param int $var - * @return $this - */ - public function setPageStart($var) - { - GPBUtil::checkInt32($var); - $this->page_start = $var; - - return $this; - } - - /** - * Page where chunk ends in the document. - * - * Generated from protobuf field int32 page_end = 2; - * @return int - */ - public function getPageEnd() - { - return $this->page_end; - } - - /** - * Page where chunk ends in the document. - * - * Generated from protobuf field int32 page_end = 2; - * @param int $var - * @return $this - */ - public function setPageEnd($var) - { - GPBUtil::checkInt32($var); - $this->page_end = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ChunkPageSpan::class, \Google\Cloud\DocumentAI\V1\Document_ChunkedDocument_Chunk_ChunkPageSpan::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout.php deleted file mode 100644 index 9314561734fc..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout - */ -class DocumentLayout extends \Google\Protobuf\Internal\Message -{ - /** - * List of blocks in the document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - */ - private $blocks; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks - * List of blocks in the document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * List of blocks in the document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlocks() - { - return $this->blocks; - } - - /** - * List of blocks in the document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlocks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); - $this->blocks = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DocumentLayout::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock.php deleted file mode 100644 index a7ccddccad7c..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock.php +++ /dev/null @@ -1,223 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock - */ -class DocumentLayoutBlock extends \Google\Protobuf\Internal\Message -{ - /** - * ID of the block. - * - * Generated from protobuf field string block_id = 1; - */ - protected $block_id = ''; - /** - * Page span of the block. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; - */ - protected $page_span = null; - protected $block; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock $text_block - * Block consisting of text content. - * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock $table_block - * Block consisting of table content/structure. - * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock $list_block - * Block consisting of list content/structure. - * @type string $block_id - * ID of the block. - * @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan $page_span - * Page span of the block. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Block consisting of text content. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock text_block = 2; - * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock|null - */ - public function getTextBlock() - { - return $this->readOneof(2); - } - - public function hasTextBlock() - { - return $this->hasOneof(2); - } - - /** - * Block consisting of text content. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock text_block = 2; - * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock $var - * @return $this - */ - public function setTextBlock($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTextBlock::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Block consisting of table content/structure. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock table_block = 3; - * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock|null - */ - public function getTableBlock() - { - return $this->readOneof(3); - } - - public function hasTableBlock() - { - return $this->hasOneof(3); - } - - /** - * Block consisting of table content/structure. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock table_block = 3; - * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock $var - * @return $this - */ - public function setTableBlock($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableBlock::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Block consisting of list content/structure. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock list_block = 4; - * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock|null - */ - public function getListBlock() - { - return $this->readOneof(4); - } - - public function hasListBlock() - { - return $this->hasOneof(4); - } - - /** - * Block consisting of list content/structure. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock list_block = 4; - * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock $var - * @return $this - */ - public function setListBlock($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListBlock::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * ID of the block. - * - * Generated from protobuf field string block_id = 1; - * @return string - */ - public function getBlockId() - { - return $this->block_id; - } - - /** - * ID of the block. - * - * Generated from protobuf field string block_id = 1; - * @param string $var - * @return $this - */ - public function setBlockId($var) - { - GPBUtil::checkString($var, True); - $this->block_id = $var; - - return $this; - } - - /** - * Page span of the block. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; - * @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan|null - */ - public function getPageSpan() - { - return $this->page_span; - } - - public function hasPageSpan() - { - return isset($this->page_span); - } - - public function clearPageSpan() - { - unset($this->page_span); - } - - /** - * Page span of the block. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan page_span = 5; - * @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan $var - * @return $this - */ - public function setPageSpan($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutPageSpan::class); - $this->page_span = $var; - - return $this; - } - - /** - * @return string - */ - public function getBlock() - { - return $this->whichOneof("block"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DocumentLayoutBlock::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php deleted file mode 100644 index 6c384415c569..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListBlock.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - */ -class LayoutListBlock extends \Google\Protobuf\Internal\Message -{ - /** - * List entries that constitute a list block. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; - */ - private $list_entries; - /** - * Type of the list_entries (if exist). Available options are `ordered` - * and `unordered`. - * - * Generated from protobuf field string type = 2; - */ - protected $type = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry>|\Google\Protobuf\Internal\RepeatedField $list_entries - * List entries that constitute a list block. - * @type string $type - * Type of the list_entries (if exist). Available options are `ordered` - * and `unordered`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * List entries that constitute a list block. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getListEntries() - { - return $this->list_entries; - } - - /** - * List entries that constitute a list block. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry list_entries = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setListEntries($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutListEntry::class); - $this->list_entries = $arr; - - return $this; - } - - /** - * Type of the list_entries (if exist). Available options are `ordered` - * and `unordered`. - * - * Generated from protobuf field string type = 2; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Type of the list_entries (if exist). Available options are `ordered` - * and `unordered`. - * - * Generated from protobuf field string type = 2; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutListBlock::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutListBlock::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php deleted file mode 100644 index 6cd2da2ccad8..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutListEntry.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - */ -class LayoutListEntry extends \Google\Protobuf\Internal\Message -{ - /** - * A list entry is a list of blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - */ - private $blocks; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks - * A list entry is a list of blocks. - * Repeated blocks support further hierarchies and nested blocks. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * A list entry is a list of blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlocks() - { - return $this->blocks; - } - - /** - * A list entry is a list of blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlocks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); - $this->blocks = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutListEntry::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutListEntry::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php deleted file mode 100644 index 98f1c810beb9..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutPageSpan.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - */ -class LayoutPageSpan extends \Google\Protobuf\Internal\Message -{ - /** - * Page where block starts in the document. - * - * Generated from protobuf field int32 page_start = 1; - */ - protected $page_start = 0; - /** - * Page where block ends in the document. - * - * Generated from protobuf field int32 page_end = 2; - */ - protected $page_end = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $page_start - * Page where block starts in the document. - * @type int $page_end - * Page where block ends in the document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Page where block starts in the document. - * - * Generated from protobuf field int32 page_start = 1; - * @return int - */ - public function getPageStart() - { - return $this->page_start; - } - - /** - * Page where block starts in the document. - * - * Generated from protobuf field int32 page_start = 1; - * @param int $var - * @return $this - */ - public function setPageStart($var) - { - GPBUtil::checkInt32($var); - $this->page_start = $var; - - return $this; - } - - /** - * Page where block ends in the document. - * - * Generated from protobuf field int32 page_end = 2; - * @return int - */ - public function getPageEnd() - { - return $this->page_end; - } - - /** - * Page where block ends in the document. - * - * Generated from protobuf field int32 page_end = 2; - * @param int $var - * @return $this - */ - public function setPageEnd($var) - { - GPBUtil::checkInt32($var); - $this->page_end = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutPageSpan::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutPageSpan::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php deleted file mode 100644 index b3236907b08d..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableBlock.php +++ /dev/null @@ -1,138 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - */ -class LayoutTableBlock extends \Google\Protobuf\Internal\Message -{ - /** - * Header rows at the top of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; - */ - private $header_rows; - /** - * Body rows containing main table content. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; - */ - private $body_rows; - /** - * Table caption/title. - * - * Generated from protobuf field string caption = 3; - */ - protected $caption = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $header_rows - * Header rows at the top of the table. - * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $body_rows - * Body rows containing main table content. - * @type string $caption - * Table caption/title. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Header rows at the top of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHeaderRows() - { - return $this->header_rows; - } - - /** - * Header rows at the top of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow header_rows = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHeaderRows($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow::class); - $this->header_rows = $arr; - - return $this; - } - - /** - * Body rows containing main table content. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBodyRows() - { - return $this->body_rows; - } - - /** - * Body rows containing main table content. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow body_rows = 2; - * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBodyRows($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableRow::class); - $this->body_rows = $arr; - - return $this; - } - - /** - * Table caption/title. - * - * Generated from protobuf field string caption = 3; - * @return string - */ - public function getCaption() - { - return $this->caption; - } - - /** - * Table caption/title. - * - * Generated from protobuf field string caption = 3; - * @param string $var - * @return $this - */ - public function setCaption($var) - { - GPBUtil::checkString($var, True); - $this->caption = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutTableBlock::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutTableBlock::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php deleted file mode 100644 index 7524382420ad..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableCell.php +++ /dev/null @@ -1,142 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - */ -class LayoutTableCell extends \Google\Protobuf\Internal\Message -{ - /** - * A table cell is a list of blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - */ - private $blocks; - /** - * How many rows this cell spans. - * - * Generated from protobuf field int32 row_span = 2; - */ - protected $row_span = 0; - /** - * How many columns this cell spans. - * - * Generated from protobuf field int32 col_span = 3; - */ - protected $col_span = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks - * A table cell is a list of blocks. - * Repeated blocks support further hierarchies and nested blocks. - * @type int $row_span - * How many rows this cell spans. - * @type int $col_span - * How many columns this cell spans. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * A table cell is a list of blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlocks() - { - return $this->blocks; - } - - /** - * A table cell is a list of blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlocks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); - $this->blocks = $arr; - - return $this; - } - - /** - * How many rows this cell spans. - * - * Generated from protobuf field int32 row_span = 2; - * @return int - */ - public function getRowSpan() - { - return $this->row_span; - } - - /** - * How many rows this cell spans. - * - * Generated from protobuf field int32 row_span = 2; - * @param int $var - * @return $this - */ - public function setRowSpan($var) - { - GPBUtil::checkInt32($var); - $this->row_span = $var; - - return $this; - } - - /** - * How many columns this cell spans. - * - * Generated from protobuf field int32 col_span = 3; - * @return int - */ - public function getColSpan() - { - return $this->col_span; - } - - /** - * How many columns this cell spans. - * - * Generated from protobuf field int32 col_span = 3; - * @param int $var - * @return $this - */ - public function setColSpan($var) - { - GPBUtil::checkInt32($var); - $this->col_span = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutTableCell::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutTableCell::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php deleted file mode 100644 index 93ace2a1d069..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTableRow.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - */ -class LayoutTableRow extends \Google\Protobuf\Internal\Message -{ - /** - * A table row is a list of table cells. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; - */ - private $cells; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell>|\Google\Protobuf\Internal\RepeatedField $cells - * A table row is a list of table cells. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * A table row is a list of table cells. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCells() - { - return $this->cells; - } - - /** - * A table row is a list of table cells. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell cells = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCells($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock\LayoutTableCell::class); - $this->cells = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutTableRow::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutTableRow::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php deleted file mode 100644 index e952d9e11f97..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/DocumentLayout/DocumentLayoutBlock/LayoutTextBlock.php +++ /dev/null @@ -1,150 +0,0 @@ -google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - */ -class LayoutTextBlock extends \Google\Protobuf\Internal\Message -{ - /** - * Text content stored in the block. - * - * Generated from protobuf field string text = 1; - */ - protected $text = ''; - /** - * Type of the text in the block. Available options are: `paragraph`, - * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, - * `heading-5`, `header`, `footer`. - * - * Generated from protobuf field string type = 2; - */ - protected $type = ''; - /** - * A text block could further have child blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; - */ - private $blocks; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * Text content stored in the block. - * @type string $type - * Type of the text in the block. Available options are: `paragraph`, - * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, - * `heading-5`, `header`, `footer`. - * @type array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $blocks - * A text block could further have child blocks. - * Repeated blocks support further hierarchies and nested blocks. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Text content stored in the block. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Text content stored in the block. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * Type of the text in the block. Available options are: `paragraph`, - * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, - * `heading-5`, `header`, `footer`. - * - * Generated from protobuf field string type = 2; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Type of the text in the block. Available options are: `paragraph`, - * `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`, - * `heading-5`, `header`, `footer`. - * - * Generated from protobuf field string type = 2; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * A text block could further have child blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlocks() - { - return $this->blocks; - } - - /** - * A text block could further have child blocks. - * Repeated blocks support further hierarchies and nested blocks. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock blocks = 3; - * @param array<\Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlocks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout\DocumentLayoutBlock::class); - $this->blocks = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutTextBlock::class, \Google\Cloud\DocumentAI\V1\Document_DocumentLayout_DocumentLayoutBlock_LayoutTextBlock::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity.php deleted file mode 100644 index b8ace41a89a5..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity.php +++ /dev/null @@ -1,488 +0,0 @@ -google.cloud.documentai.v1.Document.Entity - */ -class Entity extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Provenance of the entity. - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $text_anchor = null; - /** - * Required. Entity type from a schema e.g. `Address`. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $type = ''; - /** - * Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. - * - * Generated from protobuf field string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $mention_text = ''; - /** - * Optional. Deprecated. Use `id` field instead. - * - * Generated from protobuf field string mention_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $mention_id = ''; - /** - * Optional. Confidence of detected Schema entity. Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $confidence = 0.0; - /** - * Optional. Represents the provenance of this entity wrt. the location on - * the page where it was found. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_anchor = null; - /** - * Optional. Canonical id. This will be a unique value in the entity list - * for this document. - * - * Generated from protobuf field string id = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $id = ''; - /** - * Optional. Normalized entity value. Absent if the extracted value could - * not be converted or the type (e.g. address) is not supported for certain - * parsers. This field is also only populated for certain supported document - * types. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $normalized_value = null; - /** - * Optional. Entities can be nested to form a hierarchical data structure - * representing the content in the document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $properties; - /** - * Optional. The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $provenance = null; - /** - * Optional. Whether the entity will be redacted for de-identification - * purposes. - * - * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $redacted = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor - * Optional. Provenance of the entity. - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * @type string $type - * Required. Entity type from a schema e.g. `Address`. - * @type string $mention_text - * Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. - * @type string $mention_id - * Optional. Deprecated. Use `id` field instead. - * @type float $confidence - * Optional. Confidence of detected Schema entity. Range `[0, 1]`. - * @type \Google\Cloud\DocumentAI\V1\Document\PageAnchor $page_anchor - * Optional. Represents the provenance of this entity wrt. the location on - * the page where it was found. - * @type string $id - * Optional. Canonical id. This will be a unique value in the entity list - * for this document. - * @type \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue $normalized_value - * Optional. Normalized entity value. Absent if the extracted value could - * not be converted or the type (e.g. address) is not supported for certain - * parsers. This field is also only populated for certain supported document - * types. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $properties - * Optional. Entities can be nested to form a hierarchical data structure - * representing the content in the document. - * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance - * Optional. The history of this annotation. - * @type bool $redacted - * Optional. Whether the entity will be redacted for de-identification - * purposes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Provenance of the entity. - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null - */ - public function getTextAnchor() - { - return $this->text_anchor; - } - - public function hasTextAnchor() - { - return isset($this->text_anchor); - } - - public function clearTextAnchor() - { - unset($this->text_anchor); - } - - /** - * Optional. Provenance of the entity. - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var - * @return $this - */ - public function setTextAnchor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\TextAnchor::class); - $this->text_anchor = $var; - - return $this; - } - - /** - * Required. Entity type from a schema e.g. `Address`. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Required. Entity type from a schema e.g. `Address`. - * - * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. - * - * Generated from protobuf field string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getMentionText() - { - return $this->mention_text; - } - - /** - * Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. - * - * Generated from protobuf field string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setMentionText($var) - { - GPBUtil::checkString($var, True); - $this->mention_text = $var; - - return $this; - } - - /** - * Optional. Deprecated. Use `id` field instead. - * - * Generated from protobuf field string mention_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getMentionId() - { - return $this->mention_id; - } - - /** - * Optional. Deprecated. Use `id` field instead. - * - * Generated from protobuf field string mention_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setMentionId($var) - { - GPBUtil::checkString($var, True); - $this->mention_id = $var; - - return $this; - } - - /** - * Optional. Confidence of detected Schema entity. Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getConfidence() - { - return $this->confidence; - } - - /** - * Optional. Confidence of detected Schema entity. Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setConfidence($var) - { - GPBUtil::checkFloat($var); - $this->confidence = $var; - - return $this; - } - - /** - * Optional. Represents the provenance of this entity wrt. the location on - * the page where it was found. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\Document\PageAnchor|null - */ - public function getPageAnchor() - { - return $this->page_anchor; - } - - public function hasPageAnchor() - { - return isset($this->page_anchor); - } - - public function clearPageAnchor() - { - unset($this->page_anchor); - } - - /** - * Optional. Represents the provenance of this entity wrt. the location on - * the page where it was found. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\Document\PageAnchor $var - * @return $this - */ - public function setPageAnchor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\PageAnchor::class); - $this->page_anchor = $var; - - return $this; - } - - /** - * Optional. Canonical id. This will be a unique value in the entity list - * for this document. - * - * Generated from protobuf field string id = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Optional. Canonical id. This will be a unique value in the entity list - * for this document. - * - * Generated from protobuf field string id = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Optional. Normalized entity value. Absent if the extracted value could - * not be converted or the type (e.g. address) is not supported for certain - * parsers. This field is also only populated for certain supported document - * types. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue|null - */ - public function getNormalizedValue() - { - return $this->normalized_value; - } - - public function hasNormalizedValue() - { - return isset($this->normalized_value); - } - - public function clearNormalizedValue() - { - unset($this->normalized_value); - } - - /** - * Optional. Normalized entity value. Absent if the extracted value could - * not be converted or the type (e.g. address) is not supported for certain - * parsers. This field is also only populated for certain supported document - * types. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue $var - * @return $this - */ - public function setNormalizedValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Entity\NormalizedValue::class); - $this->normalized_value = $var; - - return $this; - } - - /** - * Optional. Entities can be nested to form a hierarchical data structure - * representing the content in the document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProperties() - { - return $this->properties; - } - - /** - * Optional. Entities can be nested to form a hierarchical data structure - * representing the content in the document. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Entity>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProperties($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Entity::class); - $this->properties = $arr; - - return $this; - } - - /** - * Optional. The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null - */ - public function getProvenance() - { - return $this->provenance; - } - - public function hasProvenance() - { - return isset($this->provenance); - } - - public function clearProvenance() - { - unset($this->provenance); - } - - /** - * Optional. The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var - * @return $this - */ - public function setProvenance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $var; - - return $this; - } - - /** - * Optional. Whether the entity will be redacted for de-identification - * purposes. - * - * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getRedacted() - { - return $this->redacted; - } - - /** - * Optional. Whether the entity will be redacted for de-identification - * purposes. - * - * Generated from protobuf field bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setRedacted($var) - { - GPBUtil::checkBool($var); - $this->redacted = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Entity::class, \Google\Cloud\DocumentAI\V1\Document_Entity::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity/NormalizedValue.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity/NormalizedValue.php deleted file mode 100644 index d6f086a4508c..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Entity/NormalizedValue.php +++ /dev/null @@ -1,357 +0,0 @@ -google.cloud.documentai.v1.Document.Entity.NormalizedValue - */ -class NormalizedValue extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. An optional field to store a normalized string. - * For some entity types, one of respective `structured_value` fields may - * also be populated. Also not all the types of `structured_value` will be - * normalized. For example, some processors may not generate `float` - * or `integer` normalized text by default. - * Below are sample formats mapped to structured values. - * - Money/Currency type (`money_value`) is in the ISO 4217 text format. - * - Date type (`date_value`) is in the ISO 8601 text format. - * - Datetime type (`datetime_value`) is in the ISO 8601 text format. - * - * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $text = ''; - protected $structured_value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Type\Money $money_value - * Money value. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/money.proto - * @type \Google\Type\Date $date_value - * Date value. Includes year, month, day. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/date.proto - * @type \Google\Type\DateTime $datetime_value - * DateTime value. Includes date, time, and timezone. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto - * @type \Google\Type\PostalAddress $address_value - * Postal address. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto - * @type bool $boolean_value - * Boolean value. Can be used for entities with binary values, or for - * checkboxes. - * @type int $integer_value - * Integer value. - * @type float $float_value - * Float value. - * @type string $text - * Optional. An optional field to store a normalized string. - * For some entity types, one of respective `structured_value` fields may - * also be populated. Also not all the types of `structured_value` will be - * normalized. For example, some processors may not generate `float` - * or `integer` normalized text by default. - * Below are sample formats mapped to structured values. - * - Money/Currency type (`money_value`) is in the ISO 4217 text format. - * - Date type (`date_value`) is in the ISO 8601 text format. - * - Datetime type (`datetime_value`) is in the ISO 8601 text format. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Money value. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/money.proto - * - * Generated from protobuf field .google.type.Money money_value = 2; - * @return \Google\Type\Money|null - */ - public function getMoneyValue() - { - return $this->readOneof(2); - } - - public function hasMoneyValue() - { - return $this->hasOneof(2); - } - - /** - * Money value. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/money.proto - * - * Generated from protobuf field .google.type.Money money_value = 2; - * @param \Google\Type\Money $var - * @return $this - */ - public function setMoneyValue($var) - { - GPBUtil::checkMessage($var, \Google\Type\Money::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Date value. Includes year, month, day. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/date.proto - * - * Generated from protobuf field .google.type.Date date_value = 3; - * @return \Google\Type\Date|null - */ - public function getDateValue() - { - return $this->readOneof(3); - } - - public function hasDateValue() - { - return $this->hasOneof(3); - } - - /** - * Date value. Includes year, month, day. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/date.proto - * - * Generated from protobuf field .google.type.Date date_value = 3; - * @param \Google\Type\Date $var - * @return $this - */ - public function setDateValue($var) - { - GPBUtil::checkMessage($var, \Google\Type\Date::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * DateTime value. Includes date, time, and timezone. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto - * - * Generated from protobuf field .google.type.DateTime datetime_value = 4; - * @return \Google\Type\DateTime|null - */ - public function getDatetimeValue() - { - return $this->readOneof(4); - } - - public function hasDatetimeValue() - { - return $this->hasOneof(4); - } - - /** - * DateTime value. Includes date, time, and timezone. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto - * - * Generated from protobuf field .google.type.DateTime datetime_value = 4; - * @param \Google\Type\DateTime $var - * @return $this - */ - public function setDatetimeValue($var) - { - GPBUtil::checkMessage($var, \Google\Type\DateTime::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Postal address. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto - * - * Generated from protobuf field .google.type.PostalAddress address_value = 5; - * @return \Google\Type\PostalAddress|null - */ - public function getAddressValue() - { - return $this->readOneof(5); - } - - public function hasAddressValue() - { - return $this->hasOneof(5); - } - - /** - * Postal address. See also: - * https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto - * - * Generated from protobuf field .google.type.PostalAddress address_value = 5; - * @param \Google\Type\PostalAddress $var - * @return $this - */ - public function setAddressValue($var) - { - GPBUtil::checkMessage($var, \Google\Type\PostalAddress::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Boolean value. Can be used for entities with binary values, or for - * checkboxes. - * - * Generated from protobuf field bool boolean_value = 6; - * @return bool - */ - public function getBooleanValue() - { - return $this->readOneof(6); - } - - public function hasBooleanValue() - { - return $this->hasOneof(6); - } - - /** - * Boolean value. Can be used for entities with binary values, or for - * checkboxes. - * - * Generated from protobuf field bool boolean_value = 6; - * @param bool $var - * @return $this - */ - public function setBooleanValue($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Integer value. - * - * Generated from protobuf field int32 integer_value = 7; - * @return int - */ - public function getIntegerValue() - { - return $this->readOneof(7); - } - - public function hasIntegerValue() - { - return $this->hasOneof(7); - } - - /** - * Integer value. - * - * Generated from protobuf field int32 integer_value = 7; - * @param int $var - * @return $this - */ - public function setIntegerValue($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Float value. - * - * Generated from protobuf field float float_value = 8; - * @return float - */ - public function getFloatValue() - { - return $this->readOneof(8); - } - - public function hasFloatValue() - { - return $this->hasOneof(8); - } - - /** - * Float value. - * - * Generated from protobuf field float float_value = 8; - * @param float $var - * @return $this - */ - public function setFloatValue($var) - { - GPBUtil::checkFloat($var); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Optional. An optional field to store a normalized string. - * For some entity types, one of respective `structured_value` fields may - * also be populated. Also not all the types of `structured_value` will be - * normalized. For example, some processors may not generate `float` - * or `integer` normalized text by default. - * Below are sample formats mapped to structured values. - * - Money/Currency type (`money_value`) is in the ISO 4217 text format. - * - Date type (`date_value`) is in the ISO 8601 text format. - * - Datetime type (`datetime_value`) is in the ISO 8601 text format. - * - * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Optional. An optional field to store a normalized string. - * For some entity types, one of respective `structured_value` fields may - * also be populated. Also not all the types of `structured_value` will be - * normalized. For example, some processors may not generate `float` - * or `integer` normalized text by default. - * Below are sample formats mapped to structured values. - * - Money/Currency type (`money_value`) is in the ISO 4217 text format. - * - Date type (`date_value`) is in the ISO 8601 text format. - * - Datetime type (`datetime_value`) is in the ISO 8601 text format. - * - * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * @return string - */ - public function getStructuredValue() - { - return $this->whichOneof("structured_value"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NormalizedValue::class, \Google\Cloud\DocumentAI\V1\Document_Entity_NormalizedValue::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/EntityRelation.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/EntityRelation.php deleted file mode 100644 index ba0880d70ebd..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/EntityRelation.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.documentai.v1.Document.EntityRelation - */ -class EntityRelation extends \Google\Protobuf\Internal\Message -{ - /** - * Subject entity id. - * - * Generated from protobuf field string subject_id = 1; - */ - protected $subject_id = ''; - /** - * Object entity id. - * - * Generated from protobuf field string object_id = 2; - */ - protected $object_id = ''; - /** - * Relationship description. - * - * Generated from protobuf field string relation = 3; - */ - protected $relation = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subject_id - * Subject entity id. - * @type string $object_id - * Object entity id. - * @type string $relation - * Relationship description. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Subject entity id. - * - * Generated from protobuf field string subject_id = 1; - * @return string - */ - public function getSubjectId() - { - return $this->subject_id; - } - - /** - * Subject entity id. - * - * Generated from protobuf field string subject_id = 1; - * @param string $var - * @return $this - */ - public function setSubjectId($var) - { - GPBUtil::checkString($var, True); - $this->subject_id = $var; - - return $this; - } - - /** - * Object entity id. - * - * Generated from protobuf field string object_id = 2; - * @return string - */ - public function getObjectId() - { - return $this->object_id; - } - - /** - * Object entity id. - * - * Generated from protobuf field string object_id = 2; - * @param string $var - * @return $this - */ - public function setObjectId($var) - { - GPBUtil::checkString($var, True); - $this->object_id = $var; - - return $this; - } - - /** - * Relationship description. - * - * Generated from protobuf field string relation = 3; - * @return string - */ - public function getRelation() - { - return $this->relation; - } - - /** - * Relationship description. - * - * Generated from protobuf field string relation = 3; - * @param string $var - * @return $this - */ - public function setRelation($var) - { - GPBUtil::checkString($var, True); - $this->relation = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EntityRelation::class, \Google\Cloud\DocumentAI\V1\Document_EntityRelation::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page.php deleted file mode 100644 index 34e47ccab957..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page.php +++ /dev/null @@ -1,719 +0,0 @@ -google.cloud.documentai.v1.Document.Page - */ -class Page extends \Google\Protobuf\Internal\Message -{ - /** - * 1-based index for current - * [Page][google.cloud.documentai.v1.Document.Page] in a parent - * [Document][google.cloud.documentai.v1.Document]. Useful when a page is - * taken out of a [Document][google.cloud.documentai.v1.Document] for - * individual processing. - * - * Generated from protobuf field int32 page_number = 1; - */ - protected $page_number = 0; - /** - * Rendered image for this page. This image is preprocessed to remove any - * skew, rotation, and distortions such that the annotation bounding boxes - * can be upright and axis-aligned. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Image image = 13; - */ - protected $image = null; - /** - * Transformation matrices that were applied to the original document image - * to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Matrix transforms = 14; - */ - private $transforms; - /** - * Physical dimension of the page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Dimension dimension = 2; - */ - protected $dimension = null; - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 3; - */ - protected $layout = null; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - */ - private $detected_languages; - /** - * A list of visually detected text blocks on the page. - * A block has a set of lines (collected into paragraphs) that have a common - * line-spacing and orientation. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Block blocks = 5; - */ - private $blocks; - /** - * A list of visually detected text paragraphs on the page. - * A collection of lines that a human would perceive as a paragraph. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Paragraph paragraphs = 6; - */ - private $paragraphs; - /** - * A list of visually detected text lines on the page. - * A collection of tokens that a human would perceive as a line. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Line lines = 7; - */ - private $lines; - /** - * A list of visually detected tokens on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Token tokens = 8; - */ - private $tokens; - /** - * A list of detected non-text visual elements e.g. checkbox, - * signature etc. on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.VisualElement visual_elements = 9; - */ - private $visual_elements; - /** - * A list of visually detected tables on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table tables = 10; - */ - private $tables; - /** - * A list of visually detected form fields on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.FormField form_fields = 11; - */ - private $form_fields; - /** - * A list of visually detected symbols on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Symbol symbols = 12; - */ - private $symbols; - /** - * A list of detected barcodes. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; - */ - private $detected_barcodes; - /** - * Image quality scores. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.ImageQualityScores image_quality_scores = 17; - */ - protected $image_quality_scores = null; - /** - * The history of this page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 16 [deprecated = true]; - * @deprecated - */ - protected $provenance = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $page_number - * 1-based index for current - * [Page][google.cloud.documentai.v1.Document.Page] in a parent - * [Document][google.cloud.documentai.v1.Document]. Useful when a page is - * taken out of a [Document][google.cloud.documentai.v1.Document] for - * individual processing. - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Image $image - * Rendered image for this page. This image is preprocessed to remove any - * skew, rotation, and distortions such that the annotation bounding boxes - * can be upright and axis-aligned. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Matrix>|\Google\Protobuf\Internal\RepeatedField $transforms - * Transformation matrices that were applied to the original document image - * to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Dimension $dimension - * Physical dimension of the page. - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Block>|\Google\Protobuf\Internal\RepeatedField $blocks - * A list of visually detected text blocks on the page. - * A block has a set of lines (collected into paragraphs) that have a common - * line-spacing and orientation. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Paragraph>|\Google\Protobuf\Internal\RepeatedField $paragraphs - * A list of visually detected text paragraphs on the page. - * A collection of lines that a human would perceive as a paragraph. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Line>|\Google\Protobuf\Internal\RepeatedField $lines - * A list of visually detected text lines on the page. - * A collection of tokens that a human would perceive as a line. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Token>|\Google\Protobuf\Internal\RepeatedField $tokens - * A list of visually detected tokens on the page. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\VisualElement>|\Google\Protobuf\Internal\RepeatedField $visual_elements - * A list of detected non-text visual elements e.g. checkbox, - * signature etc. on the page. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table>|\Google\Protobuf\Internal\RepeatedField $tables - * A list of visually detected tables on the page. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\FormField>|\Google\Protobuf\Internal\RepeatedField $form_fields - * A list of visually detected form fields on the page. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Symbol>|\Google\Protobuf\Internal\RepeatedField $symbols - * A list of visually detected symbols on the page. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedBarcode>|\Google\Protobuf\Internal\RepeatedField $detected_barcodes - * A list of detected barcodes. - * @type \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores $image_quality_scores - * Image quality scores. - * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance - * The history of this page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * 1-based index for current - * [Page][google.cloud.documentai.v1.Document.Page] in a parent - * [Document][google.cloud.documentai.v1.Document]. Useful when a page is - * taken out of a [Document][google.cloud.documentai.v1.Document] for - * individual processing. - * - * Generated from protobuf field int32 page_number = 1; - * @return int - */ - public function getPageNumber() - { - return $this->page_number; - } - - /** - * 1-based index for current - * [Page][google.cloud.documentai.v1.Document.Page] in a parent - * [Document][google.cloud.documentai.v1.Document]. Useful when a page is - * taken out of a [Document][google.cloud.documentai.v1.Document] for - * individual processing. - * - * Generated from protobuf field int32 page_number = 1; - * @param int $var - * @return $this - */ - public function setPageNumber($var) - { - GPBUtil::checkInt32($var); - $this->page_number = $var; - - return $this; - } - - /** - * Rendered image for this page. This image is preprocessed to remove any - * skew, rotation, and distortions such that the annotation bounding boxes - * can be upright and axis-aligned. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Image image = 13; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Image|null - */ - public function getImage() - { - return $this->image; - } - - public function hasImage() - { - return isset($this->image); - } - - public function clearImage() - { - unset($this->image); - } - - /** - * Rendered image for this page. This image is preprocessed to remove any - * skew, rotation, and distortions such that the annotation bounding boxes - * can be upright and axis-aligned. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Image image = 13; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Image $var - * @return $this - */ - public function setImage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Image::class); - $this->image = $var; - - return $this; - } - - /** - * Transformation matrices that were applied to the original document image - * to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Matrix transforms = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTransforms() - { - return $this->transforms; - } - - /** - * Transformation matrices that were applied to the original document image - * to produce [Page.image][google.cloud.documentai.v1.Document.Page.image]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Matrix transforms = 14; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Matrix>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTransforms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Matrix::class); - $this->transforms = $arr; - - return $this; - } - - /** - * Physical dimension of the page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Dimension dimension = 2; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Dimension|null - */ - public function getDimension() - { - return $this->dimension; - } - - public function hasDimension() - { - return isset($this->dimension); - } - - public function clearDimension() - { - unset($this->dimension); - } - - /** - * Physical dimension of the page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Dimension dimension = 2; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Dimension $var - * @return $this - */ - public function setDimension($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Dimension::class); - $this->dimension = $var; - - return $this; - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 3; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 3; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - - /** - * A list of visually detected text blocks on the page. - * A block has a set of lines (collected into paragraphs) that have a common - * line-spacing and orientation. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Block blocks = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlocks() - { - return $this->blocks; - } - - /** - * A list of visually detected text blocks on the page. - * A block has a set of lines (collected into paragraphs) that have a common - * line-spacing and orientation. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Block blocks = 5; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Block>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlocks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Block::class); - $this->blocks = $arr; - - return $this; - } - - /** - * A list of visually detected text paragraphs on the page. - * A collection of lines that a human would perceive as a paragraph. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Paragraph paragraphs = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getParagraphs() - { - return $this->paragraphs; - } - - /** - * A list of visually detected text paragraphs on the page. - * A collection of lines that a human would perceive as a paragraph. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Paragraph paragraphs = 6; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Paragraph>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setParagraphs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Paragraph::class); - $this->paragraphs = $arr; - - return $this; - } - - /** - * A list of visually detected text lines on the page. - * A collection of tokens that a human would perceive as a line. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Line lines = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLines() - { - return $this->lines; - } - - /** - * A list of visually detected text lines on the page. - * A collection of tokens that a human would perceive as a line. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Line lines = 7; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Line>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLines($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Line::class); - $this->lines = $arr; - - return $this; - } - - /** - * A list of visually detected tokens on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Token tokens = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTokens() - { - return $this->tokens; - } - - /** - * A list of visually detected tokens on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Token tokens = 8; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Token>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTokens($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Token::class); - $this->tokens = $arr; - - return $this; - } - - /** - * A list of detected non-text visual elements e.g. checkbox, - * signature etc. on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.VisualElement visual_elements = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVisualElements() - { - return $this->visual_elements; - } - - /** - * A list of detected non-text visual elements e.g. checkbox, - * signature etc. on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.VisualElement visual_elements = 9; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\VisualElement>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVisualElements($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\VisualElement::class); - $this->visual_elements = $arr; - - return $this; - } - - /** - * A list of visually detected tables on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table tables = 10; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTables() - { - return $this->tables; - } - - /** - * A list of visually detected tables on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table tables = 10; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTables($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table::class); - $this->tables = $arr; - - return $this; - } - - /** - * A list of visually detected form fields on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.FormField form_fields = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFormFields() - { - return $this->form_fields; - } - - /** - * A list of visually detected form fields on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.FormField form_fields = 11; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\FormField>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFormFields($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\FormField::class); - $this->form_fields = $arr; - - return $this; - } - - /** - * A list of visually detected symbols on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Symbol symbols = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSymbols() - { - return $this->symbols; - } - - /** - * A list of visually detected symbols on the page. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Symbol symbols = 12; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Symbol>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSymbols($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Symbol::class); - $this->symbols = $arr; - - return $this; - } - - /** - * A list of detected barcodes. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedBarcodes() - { - return $this->detected_barcodes; - } - - /** - * A list of detected barcodes. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedBarcode detected_barcodes = 15; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedBarcode>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedBarcodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedBarcode::class); - $this->detected_barcodes = $arr; - - return $this; - } - - /** - * Image quality scores. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.ImageQualityScores image_quality_scores = 17; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores|null - */ - public function getImageQualityScores() - { - return $this->image_quality_scores; - } - - public function hasImageQualityScores() - { - return isset($this->image_quality_scores); - } - - public function clearImageQualityScores() - { - unset($this->image_quality_scores); - } - - /** - * Image quality scores. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.ImageQualityScores image_quality_scores = 17; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores $var - * @return $this - */ - public function setImageQualityScores($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores::class); - $this->image_quality_scores = $var; - - return $this; - } - - /** - * The history of this page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 16 [deprecated = true]; - * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null - * @deprecated - */ - public function getProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return $this->provenance; - } - - public function hasProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return isset($this->provenance); - } - - public function clearProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - unset($this->provenance); - } - - /** - * The history of this page. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 16 [deprecated = true]; - * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var - * @return $this - * @deprecated - */ - public function setProvenance($var) - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Page::class, \Google\Cloud\DocumentAI\V1\Document_Page::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Block.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Block.php deleted file mode 100644 index e6b0f8115556..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Block.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Block - */ -class Block extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Block][google.cloud.documentai.v1.Document.Page.Block]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - */ - private $detected_languages; - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @deprecated - */ - protected $provenance = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Block][google.cloud.documentai.v1.Document.Page.Block]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance - * The history of this annotation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Block][google.cloud.documentai.v1.Document.Page.Block]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Block][google.cloud.documentai.v1.Document.Page.Block]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null - * @deprecated - */ - public function getProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return $this->provenance; - } - - public function hasProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return isset($this->provenance); - } - - public function clearProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - unset($this->provenance); - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var - * @return $this - * @deprecated - */ - public function setProvenance($var) - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Block::class, \Google\Cloud\DocumentAI\V1\Document_Page_Block::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedBarcode.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedBarcode.php deleted file mode 100644 index 813cac1753e1..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedBarcode.php +++ /dev/null @@ -1,132 +0,0 @@ -google.cloud.documentai.v1.Document.Page.DetectedBarcode - */ -class DetectedBarcode extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * Detailed barcode information of the - * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; - */ - protected $barcode = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - * @type \Google\Cloud\DocumentAI\V1\Barcode $barcode - * Detailed barcode information of the - * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * Detailed barcode information of the - * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; - * @return \Google\Cloud\DocumentAI\V1\Barcode|null - */ - public function getBarcode() - { - return $this->barcode; - } - - public function hasBarcode() - { - return isset($this->barcode); - } - - public function clearBarcode() - { - unset($this->barcode); - } - - /** - * Detailed barcode information of the - * [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Barcode barcode = 2; - * @param \Google\Cloud\DocumentAI\V1\Barcode $var - * @return $this - */ - public function setBarcode($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Barcode::class); - $this->barcode = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DetectedBarcode::class, \Google\Cloud\DocumentAI\V1\Document_Page_DetectedBarcode::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedLanguage.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedLanguage.php deleted file mode 100644 index 047bb47a331f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/DetectedLanguage.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.documentai.v1.Document.Page.DetectedLanguage - */ -class DetectedLanguage extends \Google\Protobuf\Internal\Message -{ - /** - * The [BCP-47 language - * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), - * such as `en-US` or `sr-Latn`. - * - * Generated from protobuf field string language_code = 1; - */ - protected $language_code = ''; - /** - * Confidence of detected language. Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 2; - */ - protected $confidence = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $language_code - * The [BCP-47 language - * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), - * such as `en-US` or `sr-Latn`. - * @type float $confidence - * Confidence of detected language. Range `[0, 1]`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * The [BCP-47 language - * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), - * such as `en-US` or `sr-Latn`. - * - * Generated from protobuf field string language_code = 1; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * The [BCP-47 language - * code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier), - * such as `en-US` or `sr-Latn`. - * - * Generated from protobuf field string language_code = 1; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * Confidence of detected language. Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 2; - * @return float - */ - public function getConfidence() - { - return $this->confidence; - } - - /** - * Confidence of detected language. Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 2; - * @param float $var - * @return $this - */ - public function setConfidence($var) - { - GPBUtil::checkFloat($var); - $this->confidence = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DetectedLanguage::class, \Google\Cloud\DocumentAI\V1\Document_Page_DetectedLanguage::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Dimension.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Dimension.php deleted file mode 100644 index 94fa7020c1c5..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Dimension.php +++ /dev/null @@ -1,138 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Dimension - */ -class Dimension extends \Google\Protobuf\Internal\Message -{ - /** - * Page width. - * - * Generated from protobuf field float width = 1; - */ - protected $width = 0.0; - /** - * Page height. - * - * Generated from protobuf field float height = 2; - */ - protected $height = 0.0; - /** - * Dimension unit. - * - * Generated from protobuf field string unit = 3; - */ - protected $unit = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $width - * Page width. - * @type float $height - * Page height. - * @type string $unit - * Dimension unit. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Page width. - * - * Generated from protobuf field float width = 1; - * @return float - */ - public function getWidth() - { - return $this->width; - } - - /** - * Page width. - * - * Generated from protobuf field float width = 1; - * @param float $var - * @return $this - */ - public function setWidth($var) - { - GPBUtil::checkFloat($var); - $this->width = $var; - - return $this; - } - - /** - * Page height. - * - * Generated from protobuf field float height = 2; - * @return float - */ - public function getHeight() - { - return $this->height; - } - - /** - * Page height. - * - * Generated from protobuf field float height = 2; - * @param float $var - * @return $this - */ - public function setHeight($var) - { - GPBUtil::checkFloat($var); - $this->height = $var; - - return $this; - } - - /** - * Dimension unit. - * - * Generated from protobuf field string unit = 3; - * @return string - */ - public function getUnit() - { - return $this->unit; - } - - /** - * Dimension unit. - * - * Generated from protobuf field string unit = 3; - * @param string $var - * @return $this - */ - public function setUnit($var) - { - GPBUtil::checkString($var, True); - $this->unit = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Dimension::class, \Google\Cloud\DocumentAI\V1\Document_Page_Dimension::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/FormField.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/FormField.php deleted file mode 100644 index 8eba8df34300..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/FormField.php +++ /dev/null @@ -1,382 +0,0 @@ -google.cloud.documentai.v1.Document.Page.FormField - */ -class FormField extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. - * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; - */ - protected $field_name = null; - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; - */ - protected $field_value = null; - /** - * A list of detected languages for name together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage name_detected_languages = 3; - */ - private $name_detected_languages; - /** - * A list of detected languages for value together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage value_detected_languages = 4; - */ - private $value_detected_languages; - /** - * If the value is non-textual, this field represents the type. Current - * valid values are: - * - blank (this indicates the `field_value` is normal text) - * - `unfilled_checkbox` - * - `filled_checkbox` - * - * Generated from protobuf field string value_type = 5; - */ - protected $value_type = ''; - /** - * Created for Labeling UI to export key text. - * If corrections were made to the text identified by the - * `field_name.text_anchor`, this field will contain the correction. - * - * Generated from protobuf field string corrected_key_text = 6; - */ - protected $corrected_key_text = ''; - /** - * Created for Labeling UI to export value text. - * If corrections were made to the text identified by the - * `field_value.text_anchor`, this field will contain the correction. - * - * Generated from protobuf field string corrected_value_text = 7; - */ - protected $corrected_value_text = ''; - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 8; - */ - protected $provenance = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $field_name - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. - * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $field_value - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $name_detected_languages - * A list of detected languages for name together with confidence. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $value_detected_languages - * A list of detected languages for value together with confidence. - * @type string $value_type - * If the value is non-textual, this field represents the type. Current - * valid values are: - * - blank (this indicates the `field_value` is normal text) - * - `unfilled_checkbox` - * - `filled_checkbox` - * @type string $corrected_key_text - * Created for Labeling UI to export key text. - * If corrections were made to the text identified by the - * `field_name.text_anchor`, this field will contain the correction. - * @type string $corrected_value_text - * Created for Labeling UI to export value text. - * If corrections were made to the text identified by the - * `field_value.text_anchor`, this field will contain the correction. - * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance - * The history of this annotation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. - * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getFieldName() - { - return $this->field_name; - } - - public function hasFieldName() - { - return isset($this->field_name); - } - - public function clearFieldName() - { - unset($this->field_name); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - * [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. - * e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_name = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setFieldName($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->field_name = $var; - - return $this; - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getFieldValue() - { - return $this->field_value; - } - - public function hasFieldValue() - { - return isset($this->field_value); - } - - public function clearFieldValue() - { - unset($this->field_value); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the - * [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout field_value = 2; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setFieldValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->field_value = $var; - - return $this; - } - - /** - * A list of detected languages for name together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage name_detected_languages = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNameDetectedLanguages() - { - return $this->name_detected_languages; - } - - /** - * A list of detected languages for name together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage name_detected_languages = 3; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNameDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->name_detected_languages = $arr; - - return $this; - } - - /** - * A list of detected languages for value together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage value_detected_languages = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValueDetectedLanguages() - { - return $this->value_detected_languages; - } - - /** - * A list of detected languages for value together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage value_detected_languages = 4; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValueDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->value_detected_languages = $arr; - - return $this; - } - - /** - * If the value is non-textual, this field represents the type. Current - * valid values are: - * - blank (this indicates the `field_value` is normal text) - * - `unfilled_checkbox` - * - `filled_checkbox` - * - * Generated from protobuf field string value_type = 5; - * @return string - */ - public function getValueType() - { - return $this->value_type; - } - - /** - * If the value is non-textual, this field represents the type. Current - * valid values are: - * - blank (this indicates the `field_value` is normal text) - * - `unfilled_checkbox` - * - `filled_checkbox` - * - * Generated from protobuf field string value_type = 5; - * @param string $var - * @return $this - */ - public function setValueType($var) - { - GPBUtil::checkString($var, True); - $this->value_type = $var; - - return $this; - } - - /** - * Created for Labeling UI to export key text. - * If corrections were made to the text identified by the - * `field_name.text_anchor`, this field will contain the correction. - * - * Generated from protobuf field string corrected_key_text = 6; - * @return string - */ - public function getCorrectedKeyText() - { - return $this->corrected_key_text; - } - - /** - * Created for Labeling UI to export key text. - * If corrections were made to the text identified by the - * `field_name.text_anchor`, this field will contain the correction. - * - * Generated from protobuf field string corrected_key_text = 6; - * @param string $var - * @return $this - */ - public function setCorrectedKeyText($var) - { - GPBUtil::checkString($var, True); - $this->corrected_key_text = $var; - - return $this; - } - - /** - * Created for Labeling UI to export value text. - * If corrections were made to the text identified by the - * `field_value.text_anchor`, this field will contain the correction. - * - * Generated from protobuf field string corrected_value_text = 7; - * @return string - */ - public function getCorrectedValueText() - { - return $this->corrected_value_text; - } - - /** - * Created for Labeling UI to export value text. - * If corrections were made to the text identified by the - * `field_value.text_anchor`, this field will contain the correction. - * - * Generated from protobuf field string corrected_value_text = 7; - * @param string $var - * @return $this - */ - public function setCorrectedValueText($var) - { - GPBUtil::checkString($var, True); - $this->corrected_value_text = $var; - - return $this; - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 8; - * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null - */ - public function getProvenance() - { - return $this->provenance; - } - - public function hasProvenance() - { - return isset($this->provenance); - } - - public function clearProvenance() - { - unset($this->provenance); - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 8; - * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var - * @return $this - */ - public function setProvenance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FormField::class, \Google\Cloud\DocumentAI\V1\Document_Page_FormField::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Image.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Image.php deleted file mode 100644 index d148308f1446..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Image.php +++ /dev/null @@ -1,180 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Image - */ -class Image extends \Google\Protobuf\Internal\Message -{ - /** - * Raw byte content of the image. - * - * Generated from protobuf field bytes content = 1; - */ - protected $content = ''; - /** - * Encoding [media type (MIME - * type)](https://www.iana.org/assignments/media-types/media-types.xhtml) - * for the image. - * - * Generated from protobuf field string mime_type = 2; - */ - protected $mime_type = ''; - /** - * Width of the image in pixels. - * - * Generated from protobuf field int32 width = 3; - */ - protected $width = 0; - /** - * Height of the image in pixels. - * - * Generated from protobuf field int32 height = 4; - */ - protected $height = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content - * Raw byte content of the image. - * @type string $mime_type - * Encoding [media type (MIME - * type)](https://www.iana.org/assignments/media-types/media-types.xhtml) - * for the image. - * @type int $width - * Width of the image in pixels. - * @type int $height - * Height of the image in pixels. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Raw byte content of the image. - * - * Generated from protobuf field bytes content = 1; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Raw byte content of the image. - * - * Generated from protobuf field bytes content = 1; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, False); - $this->content = $var; - - return $this; - } - - /** - * Encoding [media type (MIME - * type)](https://www.iana.org/assignments/media-types/media-types.xhtml) - * for the image. - * - * Generated from protobuf field string mime_type = 2; - * @return string - */ - public function getMimeType() - { - return $this->mime_type; - } - - /** - * Encoding [media type (MIME - * type)](https://www.iana.org/assignments/media-types/media-types.xhtml) - * for the image. - * - * Generated from protobuf field string mime_type = 2; - * @param string $var - * @return $this - */ - public function setMimeType($var) - { - GPBUtil::checkString($var, True); - $this->mime_type = $var; - - return $this; - } - - /** - * Width of the image in pixels. - * - * Generated from protobuf field int32 width = 3; - * @return int - */ - public function getWidth() - { - return $this->width; - } - - /** - * Width of the image in pixels. - * - * Generated from protobuf field int32 width = 3; - * @param int $var - * @return $this - */ - public function setWidth($var) - { - GPBUtil::checkInt32($var); - $this->width = $var; - - return $this; - } - - /** - * Height of the image in pixels. - * - * Generated from protobuf field int32 height = 4; - * @return int - */ - public function getHeight() - { - return $this->height; - } - - /** - * Height of the image in pixels. - * - * Generated from protobuf field int32 height = 4; - * @param int $var - * @return $this - */ - public function setHeight($var) - { - GPBUtil::checkInt32($var); - $this->height = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Image::class, \Google\Cloud\DocumentAI\V1\Document_Page_Image::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores.php deleted file mode 100644 index 022802ccec08..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.documentai.v1.Document.Page.ImageQualityScores - */ -class ImageQualityScores extends \Google\Protobuf\Internal\Message -{ - /** - * The overall quality score. Range `[0, 1]` where `1` is perfect quality. - * - * Generated from protobuf field float quality_score = 1; - */ - protected $quality_score = 0.0; - /** - * A list of detected defects. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect detected_defects = 2; - */ - private $detected_defects; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $quality_score - * The overall quality score. Range `[0, 1]` where `1` is perfect quality. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores\DetectedDefect>|\Google\Protobuf\Internal\RepeatedField $detected_defects - * A list of detected defects. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * The overall quality score. Range `[0, 1]` where `1` is perfect quality. - * - * Generated from protobuf field float quality_score = 1; - * @return float - */ - public function getQualityScore() - { - return $this->quality_score; - } - - /** - * The overall quality score. Range `[0, 1]` where `1` is perfect quality. - * - * Generated from protobuf field float quality_score = 1; - * @param float $var - * @return $this - */ - public function setQualityScore($var) - { - GPBUtil::checkFloat($var); - $this->quality_score = $var; - - return $this; - } - - /** - * A list of detected defects. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect detected_defects = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedDefects() - { - return $this->detected_defects; - } - - /** - * A list of detected defects. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect detected_defects = 2; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores\DetectedDefect>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedDefects($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\ImageQualityScores\DetectedDefect::class); - $this->detected_defects = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ImageQualityScores::class, \Google\Cloud\DocumentAI\V1\Document_Page_ImageQualityScores::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores/DetectedDefect.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores/DetectedDefect.php deleted file mode 100644 index 349207260af6..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/ImageQualityScores/DetectedDefect.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect - */ -class DetectedDefect extends \Google\Protobuf\Internal\Message -{ - /** - * Name of the defect type. Supported values are: - * - `quality/defect_blurry` - * - `quality/defect_noisy` - * - `quality/defect_dark` - * - `quality/defect_faint` - * - `quality/defect_text_too_small` - * - `quality/defect_document_cutoff` - * - `quality/defect_text_cutoff` - * - `quality/defect_glare` - * - * Generated from protobuf field string type = 1; - */ - protected $type = ''; - /** - * Confidence of detected defect. Range `[0, 1]` where `1` indicates - * strong confidence that the defect exists. - * - * Generated from protobuf field float confidence = 2; - */ - protected $confidence = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $type - * Name of the defect type. Supported values are: - * - `quality/defect_blurry` - * - `quality/defect_noisy` - * - `quality/defect_dark` - * - `quality/defect_faint` - * - `quality/defect_text_too_small` - * - `quality/defect_document_cutoff` - * - `quality/defect_text_cutoff` - * - `quality/defect_glare` - * @type float $confidence - * Confidence of detected defect. Range `[0, 1]` where `1` indicates - * strong confidence that the defect exists. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Name of the defect type. Supported values are: - * - `quality/defect_blurry` - * - `quality/defect_noisy` - * - `quality/defect_dark` - * - `quality/defect_faint` - * - `quality/defect_text_too_small` - * - `quality/defect_document_cutoff` - * - `quality/defect_text_cutoff` - * - `quality/defect_glare` - * - * Generated from protobuf field string type = 1; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Name of the defect type. Supported values are: - * - `quality/defect_blurry` - * - `quality/defect_noisy` - * - `quality/defect_dark` - * - `quality/defect_faint` - * - `quality/defect_text_too_small` - * - `quality/defect_document_cutoff` - * - `quality/defect_text_cutoff` - * - `quality/defect_glare` - * - * Generated from protobuf field string type = 1; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * Confidence of detected defect. Range `[0, 1]` where `1` indicates - * strong confidence that the defect exists. - * - * Generated from protobuf field float confidence = 2; - * @return float - */ - public function getConfidence() - { - return $this->confidence; - } - - /** - * Confidence of detected defect. Range `[0, 1]` where `1` indicates - * strong confidence that the defect exists. - * - * Generated from protobuf field float confidence = 2; - * @param float $var - * @return $this - */ - public function setConfidence($var) - { - GPBUtil::checkFloat($var); - $this->confidence = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DetectedDefect::class, \Google\Cloud\DocumentAI\V1\Document_Page_ImageQualityScores_DetectedDefect::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout.php deleted file mode 100644 index 88a05d40216e..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout.php +++ /dev/null @@ -1,220 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Layout - */ -class Layout extends \Google\Protobuf\Internal\Message -{ - /** - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - */ - protected $text_anchor = null; - /** - * Confidence of the current - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within - * context of the object this layout is for. e.g. confidence can be for a - * single token, a table, a visual element, etc. depending on context. - * Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 2; - */ - protected $confidence = 0.0; - /** - * The bounding polygon for the - * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - * - * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; - */ - protected $bounding_poly = null; - /** - * Detected orientation for the - * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; - */ - protected $orientation = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * @type float $confidence - * Confidence of the current - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within - * context of the object this layout is for. e.g. confidence can be for a - * single token, a table, a visual element, etc. depending on context. - * Range `[0, 1]`. - * @type \Google\Cloud\DocumentAI\V1\BoundingPoly $bounding_poly - * The bounding polygon for the - * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - * @type int $orientation - * Detected orientation for the - * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null - */ - public function getTextAnchor() - { - return $this->text_anchor; - } - - public function hasTextAnchor() - { - return isset($this->text_anchor); - } - - public function clearTextAnchor() - { - unset($this->text_anchor); - } - - /** - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var - * @return $this - */ - public function setTextAnchor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\TextAnchor::class); - $this->text_anchor = $var; - - return $this; - } - - /** - * Confidence of the current - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within - * context of the object this layout is for. e.g. confidence can be for a - * single token, a table, a visual element, etc. depending on context. - * Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 2; - * @return float - */ - public function getConfidence() - { - return $this->confidence; - } - - /** - * Confidence of the current - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] within - * context of the object this layout is for. e.g. confidence can be for a - * single token, a table, a visual element, etc. depending on context. - * Range `[0, 1]`. - * - * Generated from protobuf field float confidence = 2; - * @param float $var - * @return $this - */ - public function setConfidence($var) - { - GPBUtil::checkFloat($var); - $this->confidence = $var; - - return $this; - } - - /** - * The bounding polygon for the - * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - * - * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; - * @return \Google\Cloud\DocumentAI\V1\BoundingPoly|null - */ - public function getBoundingPoly() - { - return $this->bounding_poly; - } - - public function hasBoundingPoly() - { - return isset($this->bounding_poly); - } - - public function clearBoundingPoly() - { - unset($this->bounding_poly); - } - - /** - * The bounding polygon for the - * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - * - * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 3; - * @param \Google\Cloud\DocumentAI\V1\BoundingPoly $var - * @return $this - */ - public function setBoundingPoly($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BoundingPoly::class); - $this->bounding_poly = $var; - - return $this; - } - - /** - * Detected orientation for the - * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; - * @return int - */ - public function getOrientation() - { - return $this->orientation; - } - - /** - * Detected orientation for the - * [Layout][google.cloud.documentai.v1.Document.Page.Layout]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout.Orientation orientation = 4; - * @param int $var - * @return $this - */ - public function setOrientation($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout\Orientation::class); - $this->orientation = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Layout::class, \Google\Cloud\DocumentAI\V1\Document_Page_Layout::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout/Orientation.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout/Orientation.php deleted file mode 100644 index ecbb474f5b17..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Layout/Orientation.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Layout.Orientation - */ -class Orientation -{ - /** - * Unspecified orientation. - * - * Generated from protobuf enum ORIENTATION_UNSPECIFIED = 0; - */ - const ORIENTATION_UNSPECIFIED = 0; - /** - * Orientation is aligned with page up. - * - * Generated from protobuf enum PAGE_UP = 1; - */ - const PAGE_UP = 1; - /** - * Orientation is aligned with page right. - * Turn the head 90 degrees clockwise from upright to read. - * - * Generated from protobuf enum PAGE_RIGHT = 2; - */ - const PAGE_RIGHT = 2; - /** - * Orientation is aligned with page down. - * Turn the head 180 degrees from upright to read. - * - * Generated from protobuf enum PAGE_DOWN = 3; - */ - const PAGE_DOWN = 3; - /** - * Orientation is aligned with page left. - * Turn the head 90 degrees counterclockwise from upright to read. - * - * Generated from protobuf enum PAGE_LEFT = 4; - */ - const PAGE_LEFT = 4; - - private static $valueToName = [ - self::ORIENTATION_UNSPECIFIED => 'ORIENTATION_UNSPECIFIED', - self::PAGE_UP => 'PAGE_UP', - self::PAGE_RIGHT => 'PAGE_RIGHT', - self::PAGE_DOWN => 'PAGE_DOWN', - self::PAGE_LEFT => 'PAGE_LEFT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Orientation::class, \Google\Cloud\DocumentAI\V1\Document_Page_Layout_Orientation::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Line.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Line.php deleted file mode 100644 index 6a1b91fa2c24..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Line.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Line - */ -class Line extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Line][google.cloud.documentai.v1.Document.Page.Line]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - */ - private $detected_languages; - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @deprecated - */ - protected $provenance = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Line][google.cloud.documentai.v1.Document.Page.Line]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance - * The history of this annotation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Line][google.cloud.documentai.v1.Document.Page.Line]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Line][google.cloud.documentai.v1.Document.Page.Line]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null - * @deprecated - */ - public function getProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return $this->provenance; - } - - public function hasProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return isset($this->provenance); - } - - public function clearProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - unset($this->provenance); - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var - * @return $this - * @deprecated - */ - public function setProvenance($var) - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Line::class, \Google\Cloud\DocumentAI\V1\Document_Page_Line::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Matrix.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Matrix.php deleted file mode 100644 index 5bdd20b17c61..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Matrix.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Matrix - */ -class Matrix extends \Google\Protobuf\Internal\Message -{ - /** - * Number of rows in the matrix. - * - * Generated from protobuf field int32 rows = 1; - */ - protected $rows = 0; - /** - * Number of columns in the matrix. - * - * Generated from protobuf field int32 cols = 2; - */ - protected $cols = 0; - /** - * This encodes information about what data type the matrix uses. - * For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - * of OpenCV primitive data types, please refer to - * https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - * - * Generated from protobuf field int32 type = 3; - */ - protected $type = 0; - /** - * The matrix data. - * - * Generated from protobuf field bytes data = 4; - */ - protected $data = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $rows - * Number of rows in the matrix. - * @type int $cols - * Number of columns in the matrix. - * @type int $type - * This encodes information about what data type the matrix uses. - * For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - * of OpenCV primitive data types, please refer to - * https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - * @type string $data - * The matrix data. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Number of rows in the matrix. - * - * Generated from protobuf field int32 rows = 1; - * @return int - */ - public function getRows() - { - return $this->rows; - } - - /** - * Number of rows in the matrix. - * - * Generated from protobuf field int32 rows = 1; - * @param int $var - * @return $this - */ - public function setRows($var) - { - GPBUtil::checkInt32($var); - $this->rows = $var; - - return $this; - } - - /** - * Number of columns in the matrix. - * - * Generated from protobuf field int32 cols = 2; - * @return int - */ - public function getCols() - { - return $this->cols; - } - - /** - * Number of columns in the matrix. - * - * Generated from protobuf field int32 cols = 2; - * @param int $var - * @return $this - */ - public function setCols($var) - { - GPBUtil::checkInt32($var); - $this->cols = $var; - - return $this; - } - - /** - * This encodes information about what data type the matrix uses. - * For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - * of OpenCV primitive data types, please refer to - * https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - * - * Generated from protobuf field int32 type = 3; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * This encodes information about what data type the matrix uses. - * For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list - * of OpenCV primitive data types, please refer to - * https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html - * - * Generated from protobuf field int32 type = 3; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkInt32($var); - $this->type = $var; - - return $this; - } - - /** - * The matrix data. - * - * Generated from protobuf field bytes data = 4; - * @return string - */ - public function getData() - { - return $this->data; - } - - /** - * The matrix data. - * - * Generated from protobuf field bytes data = 4; - * @param string $var - * @return $this - */ - public function setData($var) - { - GPBUtil::checkString($var, False); - $this->data = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Matrix::class, \Google\Cloud\DocumentAI\V1\Document_Page_Matrix::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Paragraph.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Paragraph.php deleted file mode 100644 index ecf311660ec6..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Paragraph.php +++ /dev/null @@ -1,169 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Paragraph - */ -class Paragraph extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - */ - private $detected_languages; - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @deprecated - */ - protected $provenance = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance - * The history of this annotation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null - * @deprecated - */ - public function getProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return $this->provenance; - } - - public function hasProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return isset($this->provenance); - } - - public function clearProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - unset($this->provenance); - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var - * @return $this - * @deprecated - */ - public function setProvenance($var) - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Paragraph::class, \Google\Cloud\DocumentAI\V1\Document_Page_Paragraph::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Symbol.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Symbol.php deleted file mode 100644 index 823bdb5b507a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Symbol.php +++ /dev/null @@ -1,118 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Symbol - */ -class Symbol extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - */ - private $detected_languages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 2; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Symbol::class, \Google\Cloud\DocumentAI\V1\Document_Page_Symbol::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table.php deleted file mode 100644 index f92869f57296..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table.php +++ /dev/null @@ -1,237 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Table - */ -class Table extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Table][google.cloud.documentai.v1.Document.Page.Table]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * Header rows of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow header_rows = 2; - */ - private $header_rows; - /** - * Body rows of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow body_rows = 3; - */ - private $body_rows; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - */ - private $detected_languages; - /** - * The history of this table. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 5 [deprecated = true]; - * @deprecated - */ - protected $provenance = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Table][google.cloud.documentai.v1.Document.Page.Table]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $header_rows - * Header rows of the table. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $body_rows - * Body rows of the table. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance - * The history of this table. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Table][google.cloud.documentai.v1.Document.Page.Table]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Table][google.cloud.documentai.v1.Document.Page.Table]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * Header rows of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow header_rows = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getHeaderRows() - { - return $this->header_rows; - } - - /** - * Header rows of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow header_rows = 2; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setHeaderRows($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow::class); - $this->header_rows = $arr; - - return $this; - } - - /** - * Body rows of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow body_rows = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBodyRows() - { - return $this->body_rows; - } - - /** - * Body rows of the table. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableRow body_rows = 3; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBodyRows($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table\TableRow::class); - $this->body_rows = $arr; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - - /** - * The history of this table. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 5 [deprecated = true]; - * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null - * @deprecated - */ - public function getProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return $this->provenance; - } - - public function hasProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return isset($this->provenance); - } - - public function clearProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - unset($this->provenance); - } - - /** - * The history of this table. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 5 [deprecated = true]; - * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var - * @return $this - * @deprecated - */ - public function setProvenance($var) - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Table::class, \Google\Cloud\DocumentAI\V1\Document_Page_Table::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableCell.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableCell.php deleted file mode 100644 index 083ff6c4e28a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableCell.php +++ /dev/null @@ -1,186 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Table.TableCell - */ -class TableCell extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * How many rows this cell spans. - * - * Generated from protobuf field int32 row_span = 2; - */ - protected $row_span = 0; - /** - * How many columns this cell spans. - * - * Generated from protobuf field int32 col_span = 3; - */ - protected $col_span = 0; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - */ - private $detected_languages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. - * @type int $row_span - * How many rows this cell spans. - * @type int $col_span - * How many columns this cell spans. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * How many rows this cell spans. - * - * Generated from protobuf field int32 row_span = 2; - * @return int - */ - public function getRowSpan() - { - return $this->row_span; - } - - /** - * How many rows this cell spans. - * - * Generated from protobuf field int32 row_span = 2; - * @param int $var - * @return $this - */ - public function setRowSpan($var) - { - GPBUtil::checkInt32($var); - $this->row_span = $var; - - return $this; - } - - /** - * How many columns this cell spans. - * - * Generated from protobuf field int32 col_span = 3; - * @return int - */ - public function getColSpan() - { - return $this->col_span; - } - - /** - * How many columns this cell spans. - * - * Generated from protobuf field int32 col_span = 3; - * @param int $var - * @return $this - */ - public function setColSpan($var) - { - GPBUtil::checkInt32($var); - $this->col_span = $var; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TableCell::class, \Google\Cloud\DocumentAI\V1\Document_Page_Table_TableCell::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableRow.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableRow.php deleted file mode 100644 index c3c865e0ea5a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Table/TableRow.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Table.TableRow - */ -class TableRow extends \Google\Protobuf\Internal\Message -{ - /** - * Cells that make up this row. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; - */ - private $cells; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell>|\Google\Protobuf\Internal\RepeatedField $cells - * Cells that make up this row. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Cells that make up this row. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCells() - { - return $this->cells; - } - - /** - * Cells that make up this row. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.Table.TableCell cells = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCells($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\Table\TableCell::class); - $this->cells = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TableRow::class, \Google\Cloud\DocumentAI\V1\Document_Page_Table_TableRow::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token.php deleted file mode 100644 index a373a99b3ab6..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token.php +++ /dev/null @@ -1,261 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Token - */ -class Token extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Token][google.cloud.documentai.v1.Document.Page.Token]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * Detected break at the end of a - * [Token][google.cloud.documentai.v1.Document.Page.Token]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; - */ - protected $detected_break = null; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; - */ - private $detected_languages; - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 4 [deprecated = true]; - * @deprecated - */ - protected $provenance = null; - /** - * Text style attributes. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.StyleInfo style_info = 5; - */ - protected $style_info = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Token][google.cloud.documentai.v1.Document.Page.Token]. - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak $detected_break - * Detected break at the end of a - * [Token][google.cloud.documentai.v1.Document.Page.Token]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * @type \Google\Cloud\DocumentAI\V1\Document\Provenance $provenance - * The history of this annotation. - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Token\StyleInfo $style_info - * Text style attributes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Token][google.cloud.documentai.v1.Document.Page.Token]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [Token][google.cloud.documentai.v1.Document.Page.Token]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * Detected break at the end of a - * [Token][google.cloud.documentai.v1.Document.Page.Token]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak|null - */ - public function getDetectedBreak() - { - return $this->detected_break; - } - - public function hasDetectedBreak() - { - return isset($this->detected_break); - } - - public function clearDetectedBreak() - { - unset($this->detected_break); - } - - /** - * Detected break at the end of a - * [Token][google.cloud.documentai.v1.Document.Page.Token]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak detected_break = 2; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak $var - * @return $this - */ - public function setDetectedBreak($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak::class); - $this->detected_break = $var; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 4 [deprecated = true]; - * @return \Google\Cloud\DocumentAI\V1\Document\Provenance|null - * @deprecated - */ - public function getProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return $this->provenance; - } - - public function hasProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return isset($this->provenance); - } - - public function clearProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - unset($this->provenance); - } - - /** - * The history of this annotation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance provenance = 4 [deprecated = true]; - * @param \Google\Cloud\DocumentAI\V1\Document\Provenance $var - * @return $this - * @deprecated - */ - public function setProvenance($var) - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $var; - - return $this; - } - - /** - * Text style attributes. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.StyleInfo style_info = 5; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Token\StyleInfo|null - */ - public function getStyleInfo() - { - return $this->style_info; - } - - public function hasStyleInfo() - { - return isset($this->style_info); - } - - public function clearStyleInfo() - { - unset($this->style_info); - } - - /** - * Text style attributes. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.StyleInfo style_info = 5; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Token\StyleInfo $var - * @return $this - */ - public function setStyleInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Token\StyleInfo::class); - $this->style_info = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Token::class, \Google\Cloud\DocumentAI\V1\Document_Page_Token::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak.php deleted file mode 100644 index d5fe06afd4f5..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Token.DetectedBreak - */ -class DetectedBreak extends \Google\Protobuf\Internal\Message -{ - /** - * Detected break type. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; - */ - protected $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * Detected break type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Detected break type. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Detected break type. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\Page\Token\DetectedBreak\Type::class); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DetectedBreak::class, \Google\Cloud\DocumentAI\V1\Document_Page_Token_DetectedBreak::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak/Type.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak/Type.php deleted file mode 100644 index 79c8990b17fc..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/DetectedBreak/Type.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type - */ -class Type -{ - /** - * Unspecified break type. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * A single whitespace. - * - * Generated from protobuf enum SPACE = 1; - */ - const SPACE = 1; - /** - * A wider whitespace. - * - * Generated from protobuf enum WIDE_SPACE = 2; - */ - const WIDE_SPACE = 2; - /** - * A hyphen that indicates that a token has been split across lines. - * - * Generated from protobuf enum HYPHEN = 3; - */ - const HYPHEN = 3; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::SPACE => 'SPACE', - self::WIDE_SPACE => 'WIDE_SPACE', - self::HYPHEN => 'HYPHEN', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\DocumentAI\V1\Document_Page_Token_DetectedBreak_Type::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/StyleInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/StyleInfo.php deleted file mode 100644 index e696a8fffcf1..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/Token/StyleInfo.php +++ /dev/null @@ -1,586 +0,0 @@ -google.cloud.documentai.v1.Document.Page.Token.StyleInfo - */ -class StyleInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Font size in points (`1` point is `¹⁄₇₂` inches). - * - * Generated from protobuf field int32 font_size = 1; - */ - protected $font_size = 0; - /** - * Font size in pixels, equal to _unrounded - * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ - * * _resolution_ ÷ `72.0`. - * - * Generated from protobuf field double pixel_font_size = 2; - */ - protected $pixel_font_size = 0.0; - /** - * Letter spacing in points. - * - * Generated from protobuf field double letter_spacing = 3; - */ - protected $letter_spacing = 0.0; - /** - * Name or style of the font. - * - * Generated from protobuf field string font_type = 4; - */ - protected $font_type = ''; - /** - * Whether the text is bold (equivalent to - * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] - * is at least `700`). - * - * Generated from protobuf field bool bold = 5; - */ - protected $bold = false; - /** - * Whether the text is italic. - * - * Generated from protobuf field bool italic = 6; - */ - protected $italic = false; - /** - * Whether the text is underlined. - * - * Generated from protobuf field bool underlined = 7; - */ - protected $underlined = false; - /** - * Whether the text is strikethrough. This feature is not supported yet. - * - * Generated from protobuf field bool strikeout = 8; - */ - protected $strikeout = false; - /** - * Whether the text is a subscript. This feature is not supported yet. - * - * Generated from protobuf field bool subscript = 9; - */ - protected $subscript = false; - /** - * Whether the text is a superscript. This feature is not supported yet. - * - * Generated from protobuf field bool superscript = 10; - */ - protected $superscript = false; - /** - * Whether the text is in small caps. This feature is not supported yet. - * - * Generated from protobuf field bool smallcaps = 11; - */ - protected $smallcaps = false; - /** - * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). - * Normal is `400`, bold is `700`. - * - * Generated from protobuf field int32 font_weight = 12; - */ - protected $font_weight = 0; - /** - * Whether the text is handwritten. - * - * Generated from protobuf field bool handwritten = 13; - */ - protected $handwritten = false; - /** - * Color of the text. - * - * Generated from protobuf field .google.type.Color text_color = 14; - */ - protected $text_color = null; - /** - * Color of the background. - * - * Generated from protobuf field .google.type.Color background_color = 15; - */ - protected $background_color = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $font_size - * Font size in points (`1` point is `¹⁄₇₂` inches). - * @type float $pixel_font_size - * Font size in pixels, equal to _unrounded - * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ - * * _resolution_ ÷ `72.0`. - * @type float $letter_spacing - * Letter spacing in points. - * @type string $font_type - * Name or style of the font. - * @type bool $bold - * Whether the text is bold (equivalent to - * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] - * is at least `700`). - * @type bool $italic - * Whether the text is italic. - * @type bool $underlined - * Whether the text is underlined. - * @type bool $strikeout - * Whether the text is strikethrough. This feature is not supported yet. - * @type bool $subscript - * Whether the text is a subscript. This feature is not supported yet. - * @type bool $superscript - * Whether the text is a superscript. This feature is not supported yet. - * @type bool $smallcaps - * Whether the text is in small caps. This feature is not supported yet. - * @type int $font_weight - * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). - * Normal is `400`, bold is `700`. - * @type bool $handwritten - * Whether the text is handwritten. - * @type \Google\Type\Color $text_color - * Color of the text. - * @type \Google\Type\Color $background_color - * Color of the background. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Font size in points (`1` point is `¹⁄₇₂` inches). - * - * Generated from protobuf field int32 font_size = 1; - * @return int - */ - public function getFontSize() - { - return $this->font_size; - } - - /** - * Font size in points (`1` point is `¹⁄₇₂` inches). - * - * Generated from protobuf field int32 font_size = 1; - * @param int $var - * @return $this - */ - public function setFontSize($var) - { - GPBUtil::checkInt32($var); - $this->font_size = $var; - - return $this; - } - - /** - * Font size in pixels, equal to _unrounded - * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ - * * _resolution_ ÷ `72.0`. - * - * Generated from protobuf field double pixel_font_size = 2; - * @return float - */ - public function getPixelFontSize() - { - return $this->pixel_font_size; - } - - /** - * Font size in pixels, equal to _unrounded - * [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_ - * * _resolution_ ÷ `72.0`. - * - * Generated from protobuf field double pixel_font_size = 2; - * @param float $var - * @return $this - */ - public function setPixelFontSize($var) - { - GPBUtil::checkDouble($var); - $this->pixel_font_size = $var; - - return $this; - } - - /** - * Letter spacing in points. - * - * Generated from protobuf field double letter_spacing = 3; - * @return float - */ - public function getLetterSpacing() - { - return $this->letter_spacing; - } - - /** - * Letter spacing in points. - * - * Generated from protobuf field double letter_spacing = 3; - * @param float $var - * @return $this - */ - public function setLetterSpacing($var) - { - GPBUtil::checkDouble($var); - $this->letter_spacing = $var; - - return $this; - } - - /** - * Name or style of the font. - * - * Generated from protobuf field string font_type = 4; - * @return string - */ - public function getFontType() - { - return $this->font_type; - } - - /** - * Name or style of the font. - * - * Generated from protobuf field string font_type = 4; - * @param string $var - * @return $this - */ - public function setFontType($var) - { - GPBUtil::checkString($var, True); - $this->font_type = $var; - - return $this; - } - - /** - * Whether the text is bold (equivalent to - * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] - * is at least `700`). - * - * Generated from protobuf field bool bold = 5; - * @return bool - */ - public function getBold() - { - return $this->bold; - } - - /** - * Whether the text is bold (equivalent to - * [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight] - * is at least `700`). - * - * Generated from protobuf field bool bold = 5; - * @param bool $var - * @return $this - */ - public function setBold($var) - { - GPBUtil::checkBool($var); - $this->bold = $var; - - return $this; - } - - /** - * Whether the text is italic. - * - * Generated from protobuf field bool italic = 6; - * @return bool - */ - public function getItalic() - { - return $this->italic; - } - - /** - * Whether the text is italic. - * - * Generated from protobuf field bool italic = 6; - * @param bool $var - * @return $this - */ - public function setItalic($var) - { - GPBUtil::checkBool($var); - $this->italic = $var; - - return $this; - } - - /** - * Whether the text is underlined. - * - * Generated from protobuf field bool underlined = 7; - * @return bool - */ - public function getUnderlined() - { - return $this->underlined; - } - - /** - * Whether the text is underlined. - * - * Generated from protobuf field bool underlined = 7; - * @param bool $var - * @return $this - */ - public function setUnderlined($var) - { - GPBUtil::checkBool($var); - $this->underlined = $var; - - return $this; - } - - /** - * Whether the text is strikethrough. This feature is not supported yet. - * - * Generated from protobuf field bool strikeout = 8; - * @return bool - */ - public function getStrikeout() - { - return $this->strikeout; - } - - /** - * Whether the text is strikethrough. This feature is not supported yet. - * - * Generated from protobuf field bool strikeout = 8; - * @param bool $var - * @return $this - */ - public function setStrikeout($var) - { - GPBUtil::checkBool($var); - $this->strikeout = $var; - - return $this; - } - - /** - * Whether the text is a subscript. This feature is not supported yet. - * - * Generated from protobuf field bool subscript = 9; - * @return bool - */ - public function getSubscript() - { - return $this->subscript; - } - - /** - * Whether the text is a subscript. This feature is not supported yet. - * - * Generated from protobuf field bool subscript = 9; - * @param bool $var - * @return $this - */ - public function setSubscript($var) - { - GPBUtil::checkBool($var); - $this->subscript = $var; - - return $this; - } - - /** - * Whether the text is a superscript. This feature is not supported yet. - * - * Generated from protobuf field bool superscript = 10; - * @return bool - */ - public function getSuperscript() - { - return $this->superscript; - } - - /** - * Whether the text is a superscript. This feature is not supported yet. - * - * Generated from protobuf field bool superscript = 10; - * @param bool $var - * @return $this - */ - public function setSuperscript($var) - { - GPBUtil::checkBool($var); - $this->superscript = $var; - - return $this; - } - - /** - * Whether the text is in small caps. This feature is not supported yet. - * - * Generated from protobuf field bool smallcaps = 11; - * @return bool - */ - public function getSmallcaps() - { - return $this->smallcaps; - } - - /** - * Whether the text is in small caps. This feature is not supported yet. - * - * Generated from protobuf field bool smallcaps = 11; - * @param bool $var - * @return $this - */ - public function setSmallcaps($var) - { - GPBUtil::checkBool($var); - $this->smallcaps = $var; - - return $this; - } - - /** - * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). - * Normal is `400`, bold is `700`. - * - * Generated from protobuf field int32 font_weight = 12; - * @return int - */ - public function getFontWeight() - { - return $this->font_weight; - } - - /** - * TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). - * Normal is `400`, bold is `700`. - * - * Generated from protobuf field int32 font_weight = 12; - * @param int $var - * @return $this - */ - public function setFontWeight($var) - { - GPBUtil::checkInt32($var); - $this->font_weight = $var; - - return $this; - } - - /** - * Whether the text is handwritten. - * - * Generated from protobuf field bool handwritten = 13; - * @return bool - */ - public function getHandwritten() - { - return $this->handwritten; - } - - /** - * Whether the text is handwritten. - * - * Generated from protobuf field bool handwritten = 13; - * @param bool $var - * @return $this - */ - public function setHandwritten($var) - { - GPBUtil::checkBool($var); - $this->handwritten = $var; - - return $this; - } - - /** - * Color of the text. - * - * Generated from protobuf field .google.type.Color text_color = 14; - * @return \Google\Type\Color|null - */ - public function getTextColor() - { - return $this->text_color; - } - - public function hasTextColor() - { - return isset($this->text_color); - } - - public function clearTextColor() - { - unset($this->text_color); - } - - /** - * Color of the text. - * - * Generated from protobuf field .google.type.Color text_color = 14; - * @param \Google\Type\Color $var - * @return $this - */ - public function setTextColor($var) - { - GPBUtil::checkMessage($var, \Google\Type\Color::class); - $this->text_color = $var; - - return $this; - } - - /** - * Color of the background. - * - * Generated from protobuf field .google.type.Color background_color = 15; - * @return \Google\Type\Color|null - */ - public function getBackgroundColor() - { - return $this->background_color; - } - - public function hasBackgroundColor() - { - return isset($this->background_color); - } - - public function clearBackgroundColor() - { - unset($this->background_color); - } - - /** - * Color of the background. - * - * Generated from protobuf field .google.type.Color background_color = 15; - * @param \Google\Type\Color $var - * @return $this - */ - public function setBackgroundColor($var) - { - GPBUtil::checkMessage($var, \Google\Type\Color::class); - $this->background_color = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StyleInfo::class, \Google\Cloud\DocumentAI\V1\Document_Page_Token_StyleInfo::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/VisualElement.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/VisualElement.php deleted file mode 100644 index ef372b3c73a9..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Page/VisualElement.php +++ /dev/null @@ -1,157 +0,0 @@ -google.cloud.documentai.v1.Document.Page.VisualElement - */ -class VisualElement extends \Google\Protobuf\Internal\Message -{ - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - */ - protected $layout = null; - /** - * Type of the - * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - * - * Generated from protobuf field string type = 2; - */ - protected $type = ''; - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; - */ - private $detected_languages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - * @type string $type - * Type of the - * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages - * A list of detected languages together with confidence. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null - */ - public function getLayout() - { - return $this->layout; - } - - public function hasLayout() - { - return isset($this->layout); - } - - public function clearLayout() - { - unset($this->layout); - } - - /** - * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for - * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Page.Layout layout = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var - * @return $this - */ - public function setLayout($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class); - $this->layout = $var; - - return $this; - } - - /** - * Type of the - * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - * - * Generated from protobuf field string type = 2; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Type of the - * [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. - * - * Generated from protobuf field string type = 2; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDetectedLanguages() - { - return $this->detected_languages; - } - - /** - * A list of detected languages together with confidence. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 3; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDetectedLanguages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class); - $this->detected_languages = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VisualElement::class, \Google\Cloud\DocumentAI\V1\Document_Page_VisualElement::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor.php deleted file mode 100644 index 34337ca820ce..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.documentai.v1.Document.PageAnchor - */ -class PageAnchor extends \Google\Protobuf\Internal\Message -{ - /** - * One or more references to visual page elements - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; - */ - private $page_refs; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef>|\Google\Protobuf\Internal\RepeatedField $page_refs - * One or more references to visual page elements - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * One or more references to visual page elements - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPageRefs() - { - return $this->page_refs; - } - - /** - * One or more references to visual page elements - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.PageAnchor.PageRef page_refs = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPageRefs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef::class); - $this->page_refs = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PageAnchor::class, \Google\Cloud\DocumentAI\V1\Document_PageAnchor::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef.php deleted file mode 100644 index 13dbd61e2050..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef.php +++ /dev/null @@ -1,265 +0,0 @@ -google.cloud.documentai.v1.Document.PageAnchor.PageRef - */ -class PageRef extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Index into the - * [Document.pages][google.cloud.documentai.v1.Document.pages] element, - * for example using - * `[Document.pages][page_refs.page]` to locate the related page element. - * This field is skipped when its value is the default `0`. See - * https://developers.google.com/protocol-buffers/docs/proto3#json. - * - * Generated from protobuf field int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $page = 0; - /** - * Optional. The type of the layout element that is being referenced if - * any. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $layout_type = 0; - /** - * Optional. Deprecated. Use - * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] - * instead. - * - * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @deprecated - */ - protected $layout_id = ''; - /** - * Optional. Identifies the bounding polygon of a layout element on the - * page. If `layout_type` is set, the bounding polygon must be exactly the - * same to the layout element it's referring to. - * - * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $bounding_poly = null; - /** - * Optional. Confidence of detected page element, if applicable. Range - * `[0, 1]`. - * - * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $confidence = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $page - * Required. Index into the - * [Document.pages][google.cloud.documentai.v1.Document.pages] element, - * for example using - * `[Document.pages][page_refs.page]` to locate the related page element. - * This field is skipped when its value is the default `0`. See - * https://developers.google.com/protocol-buffers/docs/proto3#json. - * @type int $layout_type - * Optional. The type of the layout element that is being referenced if - * any. - * @type string $layout_id - * Optional. Deprecated. Use - * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] - * instead. - * @type \Google\Cloud\DocumentAI\V1\BoundingPoly $bounding_poly - * Optional. Identifies the bounding polygon of a layout element on the - * page. If `layout_type` is set, the bounding polygon must be exactly the - * same to the layout element it's referring to. - * @type float $confidence - * Optional. Confidence of detected page element, if applicable. Range - * `[0, 1]`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Required. Index into the - * [Document.pages][google.cloud.documentai.v1.Document.pages] element, - * for example using - * `[Document.pages][page_refs.page]` to locate the related page element. - * This field is skipped when its value is the default `0`. See - * https://developers.google.com/protocol-buffers/docs/proto3#json. - * - * Generated from protobuf field int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int|string - */ - public function getPage() - { - return $this->page; - } - - /** - * Required. Index into the - * [Document.pages][google.cloud.documentai.v1.Document.pages] element, - * for example using - * `[Document.pages][page_refs.page]` to locate the related page element. - * This field is skipped when its value is the default `0`. See - * https://developers.google.com/protocol-buffers/docs/proto3#json. - * - * Generated from protobuf field int64 page = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int|string $var - * @return $this - */ - public function setPage($var) - { - GPBUtil::checkInt64($var); - $this->page = $var; - - return $this; - } - - /** - * Optional. The type of the layout element that is being referenced if - * any. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getLayoutType() - { - return $this->layout_type; - } - - /** - * Optional. The type of the layout element that is being referenced if - * any. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType layout_type = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setLayoutType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef\LayoutType::class); - $this->layout_type = $var; - - return $this; - } - - /** - * Optional. Deprecated. Use - * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] - * instead. - * - * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @return string - * @deprecated - */ - public function getLayoutId() - { - @trigger_error('layout_id is deprecated.', E_USER_DEPRECATED); - return $this->layout_id; - } - - /** - * Optional. Deprecated. Use - * [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] - * instead. - * - * Generated from protobuf field string layout_id = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - * @deprecated - */ - public function setLayoutId($var) - { - @trigger_error('layout_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->layout_id = $var; - - return $this; - } - - /** - * Optional. Identifies the bounding polygon of a layout element on the - * page. If `layout_type` is set, the bounding polygon must be exactly the - * same to the layout element it's referring to. - * - * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\BoundingPoly|null - */ - public function getBoundingPoly() - { - return $this->bounding_poly; - } - - public function hasBoundingPoly() - { - return isset($this->bounding_poly); - } - - public function clearBoundingPoly() - { - unset($this->bounding_poly); - } - - /** - * Optional. Identifies the bounding polygon of a layout element on the - * page. If `layout_type` is set, the bounding polygon must be exactly the - * same to the layout element it's referring to. - * - * Generated from protobuf field .google.cloud.documentai.v1.BoundingPoly bounding_poly = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\BoundingPoly $var - * @return $this - */ - public function setBoundingPoly($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BoundingPoly::class); - $this->bounding_poly = $var; - - return $this; - } - - /** - * Optional. Confidence of detected page element, if applicable. Range - * `[0, 1]`. - * - * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getConfidence() - { - return $this->confidence; - } - - /** - * Optional. Confidence of detected page element, if applicable. Range - * `[0, 1]`. - * - * Generated from protobuf field float confidence = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setConfidence($var) - { - GPBUtil::checkFloat($var); - $this->confidence = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PageRef::class, \Google\Cloud\DocumentAI\V1\Document_PageAnchor_PageRef::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef/LayoutType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef/LayoutType.php deleted file mode 100644 index 59f60718b807..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/PageAnchor/PageRef/LayoutType.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType - */ -class LayoutType -{ - /** - * Layout Unspecified. - * - * Generated from protobuf enum LAYOUT_TYPE_UNSPECIFIED = 0; - */ - const LAYOUT_TYPE_UNSPECIFIED = 0; - /** - * References a - * [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] - * element. - * - * Generated from protobuf enum BLOCK = 1; - */ - const BLOCK = 1; - /** - * References a - * [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] - * element. - * - * Generated from protobuf enum PARAGRAPH = 2; - */ - const PARAGRAPH = 2; - /** - * References a - * [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. - * - * Generated from protobuf enum LINE = 3; - */ - const LINE = 3; - /** - * References a - * [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] - * element. - * - * Generated from protobuf enum TOKEN = 4; - */ - const TOKEN = 4; - /** - * References a - * [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] - * element. - * - * Generated from protobuf enum VISUAL_ELEMENT = 5; - */ - const VISUAL_ELEMENT = 5; - /** - * Refrrences a - * [Page.tables][google.cloud.documentai.v1.Document.Page.tables] - * element. - * - * Generated from protobuf enum TABLE = 6; - */ - const TABLE = 6; - /** - * References a - * [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] - * element. - * - * Generated from protobuf enum FORM_FIELD = 7; - */ - const FORM_FIELD = 7; - - private static $valueToName = [ - self::LAYOUT_TYPE_UNSPECIFIED => 'LAYOUT_TYPE_UNSPECIFIED', - self::BLOCK => 'BLOCK', - self::PARAGRAPH => 'PARAGRAPH', - self::LINE => 'LINE', - self::TOKEN => 'TOKEN', - self::VISUAL_ELEMENT => 'VISUAL_ELEMENT', - self::TABLE => 'TABLE', - self::FORM_FIELD => 'FORM_FIELD', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutType::class, \Google\Cloud\DocumentAI\V1\Document_PageAnchor_PageRef_LayoutType::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance.php deleted file mode 100644 index 862fada0a40b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance.php +++ /dev/null @@ -1,187 +0,0 @@ -google.cloud.documentai.v1.Document.Provenance - */ -class Provenance extends \Google\Protobuf\Internal\Message -{ - /** - * The index of the revision that produced this element. - * - * Generated from protobuf field int32 revision = 1 [deprecated = true]; - * @deprecated - */ - protected $revision = 0; - /** - * The Id of this operation. Needs to be unique within the scope of the - * revision. - * - * Generated from protobuf field int32 id = 2 [deprecated = true]; - * @deprecated - */ - protected $id = 0; - /** - * References to the original elements that are replaced. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance.Parent parents = 3; - */ - private $parents; - /** - * The type of provenance operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance.OperationType type = 4; - */ - protected $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $revision - * The index of the revision that produced this element. - * @type int $id - * The Id of this operation. Needs to be unique within the scope of the - * revision. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Provenance\PBParent>|\Google\Protobuf\Internal\RepeatedField $parents - * References to the original elements that are replaced. - * @type int $type - * The type of provenance operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * The index of the revision that produced this element. - * - * Generated from protobuf field int32 revision = 1 [deprecated = true]; - * @return int - * @deprecated - */ - public function getRevision() - { - @trigger_error('revision is deprecated.', E_USER_DEPRECATED); - return $this->revision; - } - - /** - * The index of the revision that produced this element. - * - * Generated from protobuf field int32 revision = 1 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setRevision($var) - { - @trigger_error('revision is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkInt32($var); - $this->revision = $var; - - return $this; - } - - /** - * The Id of this operation. Needs to be unique within the scope of the - * revision. - * - * Generated from protobuf field int32 id = 2 [deprecated = true]; - * @return int - * @deprecated - */ - public function getId() - { - @trigger_error('id is deprecated.', E_USER_DEPRECATED); - return $this->id; - } - - /** - * The Id of this operation. Needs to be unique within the scope of the - * revision. - * - * Generated from protobuf field int32 id = 2 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setId($var) - { - @trigger_error('id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkInt32($var); - $this->id = $var; - - return $this; - } - - /** - * References to the original elements that are replaced. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance.Parent parents = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getParents() - { - return $this->parents; - } - - /** - * References to the original elements that are replaced. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance.Parent parents = 3; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Provenance\PBParent>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setParents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Provenance\PBParent::class); - $this->parents = $arr; - - return $this; - } - - /** - * The type of provenance operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance.OperationType type = 4; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The type of provenance operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Provenance.OperationType type = 4; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Document\Provenance\OperationType::class); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Provenance::class, \Google\Cloud\DocumentAI\V1\Document_Provenance::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/OperationType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/OperationType.php deleted file mode 100644 index ff615ad82354..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/OperationType.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.documentai.v1.Document.Provenance.OperationType - */ -class OperationType -{ - /** - * Operation type unspecified. If no operation is specified a provenance - * entry is simply used to match against a `parent`. - * - * Generated from protobuf enum OPERATION_TYPE_UNSPECIFIED = 0; - */ - const OPERATION_TYPE_UNSPECIFIED = 0; - /** - * Add an element. - * - * Generated from protobuf enum ADD = 1; - */ - const ADD = 1; - /** - * Remove an element identified by `parent`. - * - * Generated from protobuf enum REMOVE = 2; - */ - const REMOVE = 2; - /** - * Updates any fields within the given provenance scope of the message. It - * overwrites the fields rather than replacing them. Use this when you - * want to update a field value of an entity without also updating all the - * child properties. - * - * Generated from protobuf enum UPDATE = 7; - */ - const UPDATE = 7; - /** - * Currently unused. Replace an element identified by `parent`. - * - * Generated from protobuf enum REPLACE = 3; - */ - const REPLACE = 3; - /** - * Deprecated. Request human review for the element identified by - * `parent`. - * - * Generated from protobuf enum EVAL_REQUESTED = 4 [deprecated = true]; - */ - const EVAL_REQUESTED = 4; - /** - * Deprecated. Element is reviewed and approved at human review, - * confidence will be set to 1.0. - * - * Generated from protobuf enum EVAL_APPROVED = 5 [deprecated = true]; - */ - const EVAL_APPROVED = 5; - /** - * Deprecated. Element is skipped in the validation process. - * - * Generated from protobuf enum EVAL_SKIPPED = 6 [deprecated = true]; - */ - const EVAL_SKIPPED = 6; - - private static $valueToName = [ - self::OPERATION_TYPE_UNSPECIFIED => 'OPERATION_TYPE_UNSPECIFIED', - self::ADD => 'ADD', - self::REMOVE => 'REMOVE', - self::UPDATE => 'UPDATE', - self::REPLACE => 'REPLACE', - self::EVAL_REQUESTED => 'EVAL_REQUESTED', - self::EVAL_APPROVED => 'EVAL_APPROVED', - self::EVAL_SKIPPED => 'EVAL_SKIPPED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(OperationType::class, \Google\Cloud\DocumentAI\V1\Document_Provenance_OperationType::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/PBParent.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/PBParent.php deleted file mode 100644 index 97dcd6f8da2f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Provenance/PBParent.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.documentai.v1.Document.Provenance.Parent - */ -class PBParent extends \Google\Protobuf\Internal\Message -{ - /** - * The index of the index into current revision's parent_ids list. - * - * Generated from protobuf field int32 revision = 1; - */ - protected $revision = 0; - /** - * The index of the parent item in the corresponding item list (eg. list - * of entities, properties within entities, etc.) in the parent revision. - * - * Generated from protobuf field int32 index = 3; - */ - protected $index = 0; - /** - * The id of the parent provenance. - * - * Generated from protobuf field int32 id = 2 [deprecated = true]; - * @deprecated - */ - protected $id = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $revision - * The index of the index into current revision's parent_ids list. - * @type int $index - * The index of the parent item in the corresponding item list (eg. list - * of entities, properties within entities, etc.) in the parent revision. - * @type int $id - * The id of the parent provenance. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * The index of the index into current revision's parent_ids list. - * - * Generated from protobuf field int32 revision = 1; - * @return int - */ - public function getRevision() - { - return $this->revision; - } - - /** - * The index of the index into current revision's parent_ids list. - * - * Generated from protobuf field int32 revision = 1; - * @param int $var - * @return $this - */ - public function setRevision($var) - { - GPBUtil::checkInt32($var); - $this->revision = $var; - - return $this; - } - - /** - * The index of the parent item in the corresponding item list (eg. list - * of entities, properties within entities, etc.) in the parent revision. - * - * Generated from protobuf field int32 index = 3; - * @return int - */ - public function getIndex() - { - return $this->index; - } - - /** - * The index of the parent item in the corresponding item list (eg. list - * of entities, properties within entities, etc.) in the parent revision. - * - * Generated from protobuf field int32 index = 3; - * @param int $var - * @return $this - */ - public function setIndex($var) - { - GPBUtil::checkInt32($var); - $this->index = $var; - - return $this; - } - - /** - * The id of the parent provenance. - * - * Generated from protobuf field int32 id = 2 [deprecated = true]; - * @return int - * @deprecated - */ - public function getId() - { - @trigger_error('id is deprecated.', E_USER_DEPRECATED); - return $this->id; - } - - /** - * The id of the parent provenance. - * - * Generated from protobuf field int32 id = 2 [deprecated = true]; - * @param int $var - * @return $this - * @deprecated - */ - public function setId($var) - { - @trigger_error('id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkInt32($var); - $this->id = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PBParent::class, \Google\Cloud\DocumentAI\V1\Document_Provenance_Parent::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision.php deleted file mode 100644 index ba22c0925a33..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision.php +++ /dev/null @@ -1,336 +0,0 @@ -google.cloud.documentai.v1.Document.Revision - */ -class Revision extends \Google\Protobuf\Internal\Message -{ - /** - * Id of the revision, internally generated by doc proto storage. - * Unique within the context of the document. - * - * Generated from protobuf field string id = 1; - */ - protected $id = ''; - /** - * The revisions that this revision is based on. This can include one or - * more parent (when documents are merged.) This field represents the - * index into the `revisions` field. - * - * Generated from protobuf field repeated int32 parent = 2 [deprecated = true]; - * @deprecated - */ - private $parent; - /** - * The revisions that this revision is based on. Must include all the ids - * that have anything to do with this revision - eg. there are - * `provenance.parent.revision` fields that index into this field. - * - * Generated from protobuf field repeated string parent_ids = 7; - */ - private $parent_ids; - /** - * The time that the revision was created, internally generated by - * doc proto storage at the time of create. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - */ - protected $create_time = null; - /** - * Human Review information of this revision. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6; - */ - protected $human_review = null; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $agent - * If the change was made by a person specify the name or id of that - * person. - * @type string $processor - * If the annotation was made by processor identify the processor by its - * resource name. - * @type string $id - * Id of the revision, internally generated by doc proto storage. - * Unique within the context of the document. - * @type array|\Google\Protobuf\Internal\RepeatedField $parent - * The revisions that this revision is based on. This can include one or - * more parent (when documents are merged.) This field represents the - * index into the `revisions` field. - * @type array|\Google\Protobuf\Internal\RepeatedField $parent_ids - * The revisions that this revision is based on. Must include all the ids - * that have anything to do with this revision - eg. there are - * `provenance.parent.revision` fields that index into this field. - * @type \Google\Protobuf\Timestamp $create_time - * The time that the revision was created, internally generated by - * doc proto storage at the time of create. - * @type \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview $human_review - * Human Review information of this revision. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * If the change was made by a person specify the name or id of that - * person. - * - * Generated from protobuf field string agent = 4; - * @return string - */ - public function getAgent() - { - return $this->readOneof(4); - } - - public function hasAgent() - { - return $this->hasOneof(4); - } - - /** - * If the change was made by a person specify the name or id of that - * person. - * - * Generated from protobuf field string agent = 4; - * @param string $var - * @return $this - */ - public function setAgent($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * If the annotation was made by processor identify the processor by its - * resource name. - * - * Generated from protobuf field string processor = 5; - * @return string - */ - public function getProcessor() - { - return $this->readOneof(5); - } - - public function hasProcessor() - { - return $this->hasOneof(5); - } - - /** - * If the annotation was made by processor identify the processor by its - * resource name. - * - * Generated from protobuf field string processor = 5; - * @param string $var - * @return $this - */ - public function setProcessor($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Id of the revision, internally generated by doc proto storage. - * Unique within the context of the document. - * - * Generated from protobuf field string id = 1; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Id of the revision, internally generated by doc proto storage. - * Unique within the context of the document. - * - * Generated from protobuf field string id = 1; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * The revisions that this revision is based on. This can include one or - * more parent (when documents are merged.) This field represents the - * index into the `revisions` field. - * - * Generated from protobuf field repeated int32 parent = 2 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getParent() - { - @trigger_error('parent is deprecated.', E_USER_DEPRECATED); - return $this->parent; - } - - /** - * The revisions that this revision is based on. This can include one or - * more parent (when documents are merged.) This field represents the - * index into the `revisions` field. - * - * Generated from protobuf field repeated int32 parent = 2 [deprecated = true]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setParent($var) - { - @trigger_error('parent is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->parent = $arr; - - return $this; - } - - /** - * The revisions that this revision is based on. Must include all the ids - * that have anything to do with this revision - eg. there are - * `provenance.parent.revision` fields that index into this field. - * - * Generated from protobuf field repeated string parent_ids = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getParentIds() - { - return $this->parent_ids; - } - - /** - * The revisions that this revision is based on. Must include all the ids - * that have anything to do with this revision - eg. there are - * `provenance.parent.revision` fields that index into this field. - * - * Generated from protobuf field repeated string parent_ids = 7; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setParentIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->parent_ids = $arr; - - return $this; - } - - /** - * The time that the revision was created, internally generated by - * doc proto storage at the time of create. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time that the revision was created, internally generated by - * doc proto storage at the time of create. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Human Review information of this revision. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6; - * @return \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview|null - */ - public function getHumanReview() - { - return $this->human_review; - } - - public function hasHumanReview() - { - return isset($this->human_review); - } - - public function clearHumanReview() - { - unset($this->human_review); - } - - /** - * Human Review information of this revision. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Revision.HumanReview human_review = 6; - * @param \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview $var - * @return $this - */ - public function setHumanReview($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Revision\HumanReview::class); - $this->human_review = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Revision::class, \Google\Cloud\DocumentAI\V1\Document_Revision::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision/HumanReview.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision/HumanReview.php deleted file mode 100644 index 5ed97f0bafa3..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Revision/HumanReview.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.documentai.v1.Document.Revision.HumanReview - */ -class HumanReview extends \Google\Protobuf\Internal\Message -{ - /** - * Human review state. e.g. `requested`, `succeeded`, `rejected`. - * - * Generated from protobuf field string state = 1; - */ - protected $state = ''; - /** - * A message providing more details about the current state of processing. - * For example, the rejection reason when the state is `rejected`. - * - * Generated from protobuf field string state_message = 2; - */ - protected $state_message = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $state - * Human review state. e.g. `requested`, `succeeded`, `rejected`. - * @type string $state_message - * A message providing more details about the current state of processing. - * For example, the rejection reason when the state is `rejected`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Human review state. e.g. `requested`, `succeeded`, `rejected`. - * - * Generated from protobuf field string state = 1; - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Human review state. e.g. `requested`, `succeeded`, `rejected`. - * - * Generated from protobuf field string state = 1; - * @param string $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkString($var, True); - $this->state = $var; - - return $this; - } - - /** - * A message providing more details about the current state of processing. - * For example, the rejection reason when the state is `rejected`. - * - * Generated from protobuf field string state_message = 2; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * A message providing more details about the current state of processing. - * For example, the rejection reason when the state is `rejected`. - * - * Generated from protobuf field string state_message = 2; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HumanReview::class, \Google\Cloud\DocumentAI\V1\Document_Revision_HumanReview::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ShardInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ShardInfo.php deleted file mode 100644 index 6d9bb1f585f0..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/ShardInfo.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.documentai.v1.Document.ShardInfo - */ -class ShardInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The 0-based index of this shard. - * - * Generated from protobuf field int64 shard_index = 1; - */ - protected $shard_index = 0; - /** - * Total number of shards. - * - * Generated from protobuf field int64 shard_count = 2; - */ - protected $shard_count = 0; - /** - * The index of the first character in - * [Document.text][google.cloud.documentai.v1.Document.text] in the overall - * document global text. - * - * Generated from protobuf field int64 text_offset = 3; - */ - protected $text_offset = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $shard_index - * The 0-based index of this shard. - * @type int|string $shard_count - * Total number of shards. - * @type int|string $text_offset - * The index of the first character in - * [Document.text][google.cloud.documentai.v1.Document.text] in the overall - * document global text. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * The 0-based index of this shard. - * - * Generated from protobuf field int64 shard_index = 1; - * @return int|string - */ - public function getShardIndex() - { - return $this->shard_index; - } - - /** - * The 0-based index of this shard. - * - * Generated from protobuf field int64 shard_index = 1; - * @param int|string $var - * @return $this - */ - public function setShardIndex($var) - { - GPBUtil::checkInt64($var); - $this->shard_index = $var; - - return $this; - } - - /** - * Total number of shards. - * - * Generated from protobuf field int64 shard_count = 2; - * @return int|string - */ - public function getShardCount() - { - return $this->shard_count; - } - - /** - * Total number of shards. - * - * Generated from protobuf field int64 shard_count = 2; - * @param int|string $var - * @return $this - */ - public function setShardCount($var) - { - GPBUtil::checkInt64($var); - $this->shard_count = $var; - - return $this; - } - - /** - * The index of the first character in - * [Document.text][google.cloud.documentai.v1.Document.text] in the overall - * document global text. - * - * Generated from protobuf field int64 text_offset = 3; - * @return int|string - */ - public function getTextOffset() - { - return $this->text_offset; - } - - /** - * The index of the first character in - * [Document.text][google.cloud.documentai.v1.Document.text] in the overall - * document global text. - * - * Generated from protobuf field int64 text_offset = 3; - * @param int|string $var - * @return $this - */ - public function setTextOffset($var) - { - GPBUtil::checkInt64($var); - $this->text_offset = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ShardInfo::class, \Google\Cloud\DocumentAI\V1\Document_ShardInfo::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style.php deleted file mode 100644 index 919a62161e39..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style.php +++ /dev/null @@ -1,377 +0,0 @@ -google.cloud.documentai.v1.Document.Style - */ -class Style extends \Google\Protobuf\Internal\Message -{ - /** - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - */ - protected $text_anchor = null; - /** - * Text color. - * - * Generated from protobuf field .google.type.Color color = 2; - */ - protected $color = null; - /** - * Text background color. - * - * Generated from protobuf field .google.type.Color background_color = 3; - */ - protected $background_color = null; - /** - * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). - * Possible values are `normal`, `bold`, `bolder`, and `lighter`. - * - * Generated from protobuf field string font_weight = 4; - */ - protected $font_weight = ''; - /** - * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). - * Possible values are `normal`, `italic`, and `oblique`. - * - * Generated from protobuf field string text_style = 5; - */ - protected $text_style = ''; - /** - * [Text - * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). - * Follows CSS standard. - * - * - * Generated from protobuf field string text_decoration = 6; - */ - protected $text_decoration = ''; - /** - * Font size. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; - */ - protected $font_size = null; - /** - * Font family such as `Arial`, `Times New Roman`. - * https://www.w3schools.com/cssref/pr_font_font-family.asp - * - * Generated from protobuf field string font_family = 8; - */ - protected $font_family = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * @type \Google\Type\Color $color - * Text color. - * @type \Google\Type\Color $background_color - * Text background color. - * @type string $font_weight - * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). - * Possible values are `normal`, `bold`, `bolder`, and `lighter`. - * @type string $text_style - * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). - * Possible values are `normal`, `italic`, and `oblique`. - * @type string $text_decoration - * [Text - * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). - * Follows CSS standard. - * - * @type \Google\Cloud\DocumentAI\V1\Document\Style\FontSize $font_size - * Font size. - * @type string $font_family - * Font family such as `Arial`, `Times New Roman`. - * https://www.w3schools.com/cssref/pr_font_font-family.asp - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null - */ - public function getTextAnchor() - { - return $this->text_anchor; - } - - public function hasTextAnchor() - { - return isset($this->text_anchor); - } - - public function clearTextAnchor() - { - unset($this->text_anchor); - } - - /** - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var - * @return $this - */ - public function setTextAnchor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\TextAnchor::class); - $this->text_anchor = $var; - - return $this; - } - - /** - * Text color. - * - * Generated from protobuf field .google.type.Color color = 2; - * @return \Google\Type\Color|null - */ - public function getColor() - { - return $this->color; - } - - public function hasColor() - { - return isset($this->color); - } - - public function clearColor() - { - unset($this->color); - } - - /** - * Text color. - * - * Generated from protobuf field .google.type.Color color = 2; - * @param \Google\Type\Color $var - * @return $this - */ - public function setColor($var) - { - GPBUtil::checkMessage($var, \Google\Type\Color::class); - $this->color = $var; - - return $this; - } - - /** - * Text background color. - * - * Generated from protobuf field .google.type.Color background_color = 3; - * @return \Google\Type\Color|null - */ - public function getBackgroundColor() - { - return $this->background_color; - } - - public function hasBackgroundColor() - { - return isset($this->background_color); - } - - public function clearBackgroundColor() - { - unset($this->background_color); - } - - /** - * Text background color. - * - * Generated from protobuf field .google.type.Color background_color = 3; - * @param \Google\Type\Color $var - * @return $this - */ - public function setBackgroundColor($var) - { - GPBUtil::checkMessage($var, \Google\Type\Color::class); - $this->background_color = $var; - - return $this; - } - - /** - * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). - * Possible values are `normal`, `bold`, `bolder`, and `lighter`. - * - * Generated from protobuf field string font_weight = 4; - * @return string - */ - public function getFontWeight() - { - return $this->font_weight; - } - - /** - * [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp). - * Possible values are `normal`, `bold`, `bolder`, and `lighter`. - * - * Generated from protobuf field string font_weight = 4; - * @param string $var - * @return $this - */ - public function setFontWeight($var) - { - GPBUtil::checkString($var, True); - $this->font_weight = $var; - - return $this; - } - - /** - * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). - * Possible values are `normal`, `italic`, and `oblique`. - * - * Generated from protobuf field string text_style = 5; - * @return string - */ - public function getTextStyle() - { - return $this->text_style; - } - - /** - * [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp). - * Possible values are `normal`, `italic`, and `oblique`. - * - * Generated from protobuf field string text_style = 5; - * @param string $var - * @return $this - */ - public function setTextStyle($var) - { - GPBUtil::checkString($var, True); - $this->text_style = $var; - - return $this; - } - - /** - * [Text - * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). - * Follows CSS standard. - * - * - * Generated from protobuf field string text_decoration = 6; - * @return string - */ - public function getTextDecoration() - { - return $this->text_decoration; - } - - /** - * [Text - * decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp). - * Follows CSS standard. - * - * - * Generated from protobuf field string text_decoration = 6; - * @param string $var - * @return $this - */ - public function setTextDecoration($var) - { - GPBUtil::checkString($var, True); - $this->text_decoration = $var; - - return $this; - } - - /** - * Font size. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; - * @return \Google\Cloud\DocumentAI\V1\Document\Style\FontSize|null - */ - public function getFontSize() - { - return $this->font_size; - } - - public function hasFontSize() - { - return isset($this->font_size); - } - - public function clearFontSize() - { - unset($this->font_size); - } - - /** - * Font size. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.Style.FontSize font_size = 7; - * @param \Google\Cloud\DocumentAI\V1\Document\Style\FontSize $var - * @return $this - */ - public function setFontSize($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Style\FontSize::class); - $this->font_size = $var; - - return $this; - } - - /** - * Font family such as `Arial`, `Times New Roman`. - * https://www.w3schools.com/cssref/pr_font_font-family.asp - * - * Generated from protobuf field string font_family = 8; - * @return string - */ - public function getFontFamily() - { - return $this->font_family; - } - - /** - * Font family such as `Arial`, `Times New Roman`. - * https://www.w3schools.com/cssref/pr_font_font-family.asp - * - * Generated from protobuf field string font_family = 8; - * @param string $var - * @return $this - */ - public function setFontFamily($var) - { - GPBUtil::checkString($var, True); - $this->font_family = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Style::class, \Google\Cloud\DocumentAI\V1\Document_Style::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style/FontSize.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style/FontSize.php deleted file mode 100644 index 0df1bbb3866b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/Style/FontSize.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.documentai.v1.Document.Style.FontSize - */ -class FontSize extends \Google\Protobuf\Internal\Message -{ - /** - * Font size for the text. - * - * Generated from protobuf field float size = 1; - */ - protected $size = 0.0; - /** - * Unit for the font size. Follows CSS naming (such as `in`, `px`, and - * `pt`). - * - * Generated from protobuf field string unit = 2; - */ - protected $unit = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $size - * Font size for the text. - * @type string $unit - * Unit for the font size. Follows CSS naming (such as `in`, `px`, and - * `pt`). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Font size for the text. - * - * Generated from protobuf field float size = 1; - * @return float - */ - public function getSize() - { - return $this->size; - } - - /** - * Font size for the text. - * - * Generated from protobuf field float size = 1; - * @param float $var - * @return $this - */ - public function setSize($var) - { - GPBUtil::checkFloat($var); - $this->size = $var; - - return $this; - } - - /** - * Unit for the font size. Follows CSS naming (such as `in`, `px`, and - * `pt`). - * - * Generated from protobuf field string unit = 2; - * @return string - */ - public function getUnit() - { - return $this->unit; - } - - /** - * Unit for the font size. Follows CSS naming (such as `in`, `px`, and - * `pt`). - * - * Generated from protobuf field string unit = 2; - * @param string $var - * @return $this - */ - public function setUnit($var) - { - GPBUtil::checkString($var, True); - $this->unit = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FontSize::class, \Google\Cloud\DocumentAI\V1\Document_Style_FontSize::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor.php deleted file mode 100644 index d0ae3fa3ca95..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.documentai.v1.Document.TextAnchor - */ -class TextAnchor extends \Google\Protobuf\Internal\Message -{ - /** - * The text segments from the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; - */ - private $text_segments; - /** - * Contains the content of the text span so that users do - * not have to look it up in the text_segments. It is always - * populated for formFields. - * - * Generated from protobuf field string content = 2; - */ - protected $content = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Document\TextAnchor\TextSegment>|\Google\Protobuf\Internal\RepeatedField $text_segments - * The text segments from the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * @type string $content - * Contains the content of the text span so that users do - * not have to look it up in the text_segments. It is always - * populated for formFields. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * The text segments from the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTextSegments() - { - return $this->text_segments; - } - - /** - * The text segments from the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.TextAnchor.TextSegment text_segments = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Document\TextAnchor\TextSegment>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTextSegments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\TextAnchor\TextSegment::class); - $this->text_segments = $arr; - - return $this; - } - - /** - * Contains the content of the text span so that users do - * not have to look it up in the text_segments. It is always - * populated for formFields. - * - * Generated from protobuf field string content = 2; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Contains the content of the text span so that users do - * not have to look it up in the text_segments. It is always - * populated for formFields. - * - * Generated from protobuf field string content = 2; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, True); - $this->content = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TextAnchor::class, \Google\Cloud\DocumentAI\V1\Document_TextAnchor::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor/TextSegment.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor/TextSegment.php deleted file mode 100644 index 7f67fa87c9e7..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextAnchor/TextSegment.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.documentai.v1.Document.TextAnchor.TextSegment - */ -class TextSegment extends \Google\Protobuf\Internal\Message -{ - /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - * start UTF-8 char index in the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field int64 start_index = 1; - */ - protected $start_index = 0; - /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - * half open end UTF-8 char index in the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field int64 end_index = 2; - */ - protected $end_index = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $start_index - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - * start UTF-8 char index in the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * @type int|string $end_index - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - * half open end UTF-8 char index in the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - * start UTF-8 char index in the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field int64 start_index = 1; - * @return int|string - */ - public function getStartIndex() - { - return $this->start_index; - } - - /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - * start UTF-8 char index in the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field int64 start_index = 1; - * @param int|string $var - * @return $this - */ - public function setStartIndex($var) - { - GPBUtil::checkInt64($var); - $this->start_index = $var; - - return $this; - } - - /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - * half open end UTF-8 char index in the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field int64 end_index = 2; - * @return int|string - */ - public function getEndIndex() - { - return $this->end_index; - } - - /** - * [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] - * half open end UTF-8 char index in the - * [Document.text][google.cloud.documentai.v1.Document.text]. - * - * Generated from protobuf field int64 end_index = 2; - * @param int|string $var - * @return $this - */ - public function setEndIndex($var) - { - GPBUtil::checkInt64($var); - $this->end_index = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TextSegment::class, \Google\Cloud\DocumentAI\V1\Document_TextAnchor_TextSegment::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextChange.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextChange.php deleted file mode 100644 index ed6ad16e5623..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Document/TextChange.php +++ /dev/null @@ -1,173 +0,0 @@ -google.cloud.documentai.v1.Document.TextChange - */ -class TextChange extends \Google\Protobuf\Internal\Message -{ - /** - * Provenance of the correction. - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. There can - * only be a single `TextAnchor.text_segments` element. If the start and - * end index of the text segment are the same, the text change is inserted - * before that index. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - */ - protected $text_anchor = null; - /** - * The text that replaces the text identified in the `text_anchor`. - * - * Generated from protobuf field string changed_text = 2; - */ - protected $changed_text = ''; - /** - * The history of this annotation. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @deprecated - */ - private $provenance; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document\TextAnchor $text_anchor - * Provenance of the correction. - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. There can - * only be a single `TextAnchor.text_segments` element. If the start and - * end index of the text segment are the same, the text change is inserted - * before that index. - * @type string $changed_text - * The text that replaces the text identified in the `text_anchor`. - * @type array<\Google\Cloud\DocumentAI\V1\Document\Provenance>|\Google\Protobuf\Internal\RepeatedField $provenance - * The history of this annotation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Provenance of the correction. - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. There can - * only be a single `TextAnchor.text_segments` element. If the start and - * end index of the text segment are the same, the text change is inserted - * before that index. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - * @return \Google\Cloud\DocumentAI\V1\Document\TextAnchor|null - */ - public function getTextAnchor() - { - return $this->text_anchor; - } - - public function hasTextAnchor() - { - return isset($this->text_anchor); - } - - public function clearTextAnchor() - { - unset($this->text_anchor); - } - - /** - * Provenance of the correction. - * Text anchor indexing into the - * [Document.text][google.cloud.documentai.v1.Document.text]. There can - * only be a single `TextAnchor.text_segments` element. If the start and - * end index of the text segment are the same, the text change is inserted - * before that index. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document.TextAnchor text_anchor = 1; - * @param \Google\Cloud\DocumentAI\V1\Document\TextAnchor $var - * @return $this - */ - public function setTextAnchor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\TextAnchor::class); - $this->text_anchor = $var; - - return $this; - } - - /** - * The text that replaces the text identified in the `text_anchor`. - * - * Generated from protobuf field string changed_text = 2; - * @return string - */ - public function getChangedText() - { - return $this->changed_text; - } - - /** - * The text that replaces the text identified in the `text_anchor`. - * - * Generated from protobuf field string changed_text = 2; - * @param string $var - * @return $this - */ - public function setChangedText($var) - { - GPBUtil::checkString($var, True); - $this->changed_text = $var; - - return $this; - } - - /** - * The history of this annotation. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getProvenance() - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - return $this->provenance; - } - - /** - * The history of this annotation. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Document.Provenance provenance = 3 [deprecated = true]; - * @param array<\Google\Cloud\DocumentAI\V1\Document\Provenance>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setProvenance($var) - { - @trigger_error('provenance is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Provenance::class); - $this->provenance = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TextChange::class, \Google\Cloud\DocumentAI\V1\Document_TextChange::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig.php deleted file mode 100644 index d7f41a08760d..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig.php +++ /dev/null @@ -1,76 +0,0 @@ -google.cloud.documentai.v1.DocumentOutputConfig - */ -class DocumentOutputConfig extends \Google\Protobuf\Internal\Message -{ - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig $gcs_output_config - * Output config to write the results to Cloud Storage. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * Output config to write the results to Cloud Storage. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig gcs_output_config = 1; - * @return \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig|null - */ - public function getGcsOutputConfig() - { - return $this->readOneof(1); - } - - public function hasGcsOutputConfig() - { - return $this->hasOneof(1); - } - - /** - * Output config to write the results to Cloud Storage. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig gcs_output_config = 1; - * @param \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig $var - * @return $this - */ - public function setGcsOutputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig.php deleted file mode 100644 index cbbd78f0a971..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig.php +++ /dev/null @@ -1,166 +0,0 @@ -google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - */ -class GcsOutputConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The Cloud Storage uri (a directory) of the output. - * - * Generated from protobuf field string gcs_uri = 1; - */ - protected $gcs_uri = ''; - /** - * Specifies which fields to include in the output documents. - * Only supports top level document and pages field so it must be in the - * form of `{document_field_name}` or `pages.{page_field_name}`. - * - * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; - */ - protected $field_mask = null; - /** - * Specifies the sharding config for the output document. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig sharding_config = 3; - */ - protected $sharding_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $gcs_uri - * The Cloud Storage uri (a directory) of the output. - * @type \Google\Protobuf\FieldMask $field_mask - * Specifies which fields to include in the output documents. - * Only supports top level document and pages field so it must be in the - * form of `{document_field_name}` or `pages.{page_field_name}`. - * @type \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig\ShardingConfig $sharding_config - * Specifies the sharding config for the output document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * The Cloud Storage uri (a directory) of the output. - * - * Generated from protobuf field string gcs_uri = 1; - * @return string - */ - public function getGcsUri() - { - return $this->gcs_uri; - } - - /** - * The Cloud Storage uri (a directory) of the output. - * - * Generated from protobuf field string gcs_uri = 1; - * @param string $var - * @return $this - */ - public function setGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->gcs_uri = $var; - - return $this; - } - - /** - * Specifies which fields to include in the output documents. - * Only supports top level document and pages field so it must be in the - * form of `{document_field_name}` or `pages.{page_field_name}`. - * - * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getFieldMask() - { - return $this->field_mask; - } - - public function hasFieldMask() - { - return isset($this->field_mask); - } - - public function clearFieldMask() - { - unset($this->field_mask); - } - - /** - * Specifies which fields to include in the output documents. - * Only supports top level document and pages field so it must be in the - * form of `{document_field_name}` or `pages.{page_field_name}`. - * - * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setFieldMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->field_mask = $var; - - return $this; - } - - /** - * Specifies the sharding config for the output document. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig sharding_config = 3; - * @return \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig\ShardingConfig|null - */ - public function getShardingConfig() - { - return $this->sharding_config; - } - - public function hasShardingConfig() - { - return isset($this->sharding_config); - } - - public function clearShardingConfig() - { - unset($this->sharding_config); - } - - /** - * Specifies the sharding config for the output document. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig sharding_config = 3; - * @param \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig\ShardingConfig $var - * @return $this - */ - public function setShardingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig\GcsOutputConfig\ShardingConfig::class); - $this->sharding_config = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(GcsOutputConfig::class, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig_GcsOutputConfig::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php deleted file mode 100644 index 9764b5c850c0..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentOutputConfig/GcsOutputConfig/ShardingConfig.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - */ -class ShardingConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The number of pages per shard. - * - * Generated from protobuf field int32 pages_per_shard = 1; - */ - protected $pages_per_shard = 0; - /** - * The number of overlapping pages between consecutive shards. - * - * Generated from protobuf field int32 pages_overlap = 2; - */ - protected $pages_overlap = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $pages_per_shard - * The number of pages per shard. - * @type int $pages_overlap - * The number of overlapping pages between consecutive shards. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * The number of pages per shard. - * - * Generated from protobuf field int32 pages_per_shard = 1; - * @return int - */ - public function getPagesPerShard() - { - return $this->pages_per_shard; - } - - /** - * The number of pages per shard. - * - * Generated from protobuf field int32 pages_per_shard = 1; - * @param int $var - * @return $this - */ - public function setPagesPerShard($var) - { - GPBUtil::checkInt32($var); - $this->pages_per_shard = $var; - - return $this; - } - - /** - * The number of overlapping pages between consecutive shards. - * - * Generated from protobuf field int32 pages_overlap = 2; - * @return int - */ - public function getPagesOverlap() - { - return $this->pages_overlap; - } - - /** - * The number of overlapping pages between consecutive shards. - * - * Generated from protobuf field int32 pages_overlap = 2; - * @param int $var - * @return $this - */ - public function setPagesOverlap($var) - { - GPBUtil::checkInt32($var); - $this->pages_overlap = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ShardingConfig::class, \Google\Cloud\DocumentAI\V1\DocumentOutputConfig_GcsOutputConfig_ShardingConfig::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema.php deleted file mode 100644 index 13b434f2f8a4..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema.php +++ /dev/null @@ -1,179 +0,0 @@ -google.cloud.documentai.v1.DocumentSchema - */ -class DocumentSchema extends \Google\Protobuf\Internal\Message -{ - /** - * Display name to show to users. - * - * Generated from protobuf field string display_name = 1; - */ - protected $display_name = ''; - /** - * Description of the schema. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Entity types of the schema. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; - */ - private $entity_types; - /** - * Metadata of the schema. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; - */ - protected $metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $display_name - * Display name to show to users. - * @type string $description - * Description of the schema. - * @type array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType>|\Google\Protobuf\Internal\RepeatedField $entity_types - * Entity types of the schema. - * @type \Google\Cloud\DocumentAI\V1\DocumentSchema\Metadata $metadata - * Metadata of the schema. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); - parent::__construct($data); - } - - /** - * Display name to show to users. - * - * Generated from protobuf field string display_name = 1; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Display name to show to users. - * - * Generated from protobuf field string display_name = 1; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Description of the schema. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Description of the schema. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Entity types of the schema. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntityTypes() - { - return $this->entity_types; - } - - /** - * Entity types of the schema. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType entity_types = 3; - * @param array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntityTypes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType::class); - $this->entity_types = $arr; - - return $this; - } - - /** - * Metadata of the schema. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; - * @return \Google\Cloud\DocumentAI\V1\DocumentSchema\Metadata|null - */ - public function getMetadata() - { - return $this->metadata; - } - - public function hasMetadata() - { - return isset($this->metadata); - } - - public function clearMetadata() - { - unset($this->metadata); - } - - /** - * Metadata of the schema. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.Metadata metadata = 4; - * @param \Google\Cloud\DocumentAI\V1\DocumentSchema\Metadata $var - * @return $this - */ - public function setMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema\Metadata::class); - $this->metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType.php deleted file mode 100644 index 72b224ab8df9..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType.php +++ /dev/null @@ -1,276 +0,0 @@ -google.cloud.documentai.v1.DocumentSchema.EntityType - */ -class EntityType extends \Google\Protobuf\Internal\Message -{ - /** - * User defined name for the type. - * - * Generated from protobuf field string display_name = 13; - */ - protected $display_name = ''; - /** - * Name of the type. It must be unique within the schema file and - * cannot be a "Common Type". The following naming conventions are used: - * - Use `snake_casing`. - * - Name matching is case-sensitive. - * - Maximum 64 characters. - * - Must start with a letter. - * - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward - * compatibility internal infrastructure and tooling can handle any ascii - * character.) - * - The `/` is sometimes used to denote a property of a type. For example - * `line_item/amount`. This convention is deprecated, but will still be - * honored for backward compatibility. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The entity type that this type is derived from. For now, one and only - * one should be set. - * - * Generated from protobuf field repeated string base_types = 2; - */ - private $base_types; - /** - * Description the nested structure, or composition of an entity. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; - */ - private $properties; - protected $value_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues $enum_values - * If specified, lists all the possible values for this entity. This - * should not be more than a handful of values. If the number of values - * is >10 or could change frequently use the `EntityType.value_ontology` - * field and specify a list of all possible values in a value ontology - * file. - * @type string $display_name - * User defined name for the type. - * @type string $name - * Name of the type. It must be unique within the schema file and - * cannot be a "Common Type". The following naming conventions are used: - * - Use `snake_casing`. - * - Name matching is case-sensitive. - * - Maximum 64 characters. - * - Must start with a letter. - * - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward - * compatibility internal infrastructure and tooling can handle any ascii - * character.) - * - The `/` is sometimes used to denote a property of a type. For example - * `line_item/amount`. This convention is deprecated, but will still be - * honored for backward compatibility. - * @type array|\Google\Protobuf\Internal\RepeatedField $base_types - * The entity type that this type is derived from. For now, one and only - * one should be set. - * @type array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property>|\Google\Protobuf\Internal\RepeatedField $properties - * Description the nested structure, or composition of an entity. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); - parent::__construct($data); - } - - /** - * If specified, lists all the possible values for this entity. This - * should not be more than a handful of values. If the number of values - * is >10 or could change frequently use the `EntityType.value_ontology` - * field and specify a list of all possible values in a value ontology - * file. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; - * @return \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues|null - */ - public function getEnumValues() - { - return $this->readOneof(14); - } - - public function hasEnumValues() - { - return $this->hasOneof(14); - } - - /** - * If specified, lists all the possible values for this entity. This - * should not be more than a handful of values. If the number of values - * is >10 or could change frequently use the `EntityType.value_ontology` - * field and specify a list of all possible values in a value ontology - * file. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14; - * @param \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues $var - * @return $this - */ - public function setEnumValues($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues::class); - $this->writeOneof(14, $var); - - return $this; - } - - /** - * User defined name for the type. - * - * Generated from protobuf field string display_name = 13; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User defined name for the type. - * - * Generated from protobuf field string display_name = 13; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Name of the type. It must be unique within the schema file and - * cannot be a "Common Type". The following naming conventions are used: - * - Use `snake_casing`. - * - Name matching is case-sensitive. - * - Maximum 64 characters. - * - Must start with a letter. - * - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward - * compatibility internal infrastructure and tooling can handle any ascii - * character.) - * - The `/` is sometimes used to denote a property of a type. For example - * `line_item/amount`. This convention is deprecated, but will still be - * honored for backward compatibility. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the type. It must be unique within the schema file and - * cannot be a "Common Type". The following naming conventions are used: - * - Use `snake_casing`. - * - Name matching is case-sensitive. - * - Maximum 64 characters. - * - Must start with a letter. - * - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward - * compatibility internal infrastructure and tooling can handle any ascii - * character.) - * - The `/` is sometimes used to denote a property of a type. For example - * `line_item/amount`. This convention is deprecated, but will still be - * honored for backward compatibility. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The entity type that this type is derived from. For now, one and only - * one should be set. - * - * Generated from protobuf field repeated string base_types = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBaseTypes() - { - return $this->base_types; - } - - /** - * The entity type that this type is derived from. For now, one and only - * one should be set. - * - * Generated from protobuf field repeated string base_types = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBaseTypes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->base_types = $arr; - - return $this; - } - - /** - * Description the nested structure, or composition of an entity. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProperties() - { - return $this->properties; - } - - /** - * Description the nested structure, or composition of an entity. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6; - * @param array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProperties($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property::class); - $this->properties = $arr; - - return $this; - } - - /** - * @return string - */ - public function getValueSource() - { - return $this->whichOneof("value_source"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EntityType::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_EntityType::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/EnumValues.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/EnumValues.php deleted file mode 100644 index 40edb0b0d86f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/EnumValues.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - */ -class EnumValues extends \Google\Protobuf\Internal\Message -{ - /** - * The individual values that this enum values type can include. - * - * Generated from protobuf field repeated string values = 1; - */ - private $values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $values - * The individual values that this enum values type can include. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); - parent::__construct($data); - } - - /** - * The individual values that this enum values type can include. - * - * Generated from protobuf field repeated string values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * The individual values that this enum values type can include. - * - * Generated from protobuf field repeated string values = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->values = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EnumValues::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_EntityType_EnumValues::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property.php deleted file mode 100644 index 361a9adebd72..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property.php +++ /dev/null @@ -1,184 +0,0 @@ -google.cloud.documentai.v1.DocumentSchema.EntityType.Property - */ -class Property extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the property. Follows the same guidelines as the - * EntityType name. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * User defined name for the property. - * - * Generated from protobuf field string display_name = 6; - */ - protected $display_name = ''; - /** - * A reference to the value type of the property. This type is subject - * to the same conventions as the `Entity.base_types` field. - * - * Generated from protobuf field string value_type = 2; - */ - protected $value_type = ''; - /** - * Occurrence type limits the number of instances an entity type appears - * in the document. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; - */ - protected $occurrence_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the property. Follows the same guidelines as the - * EntityType name. - * @type string $display_name - * User defined name for the property. - * @type string $value_type - * A reference to the value type of the property. This type is subject - * to the same conventions as the `Entity.base_types` field. - * @type int $occurrence_type - * Occurrence type limits the number of instances an entity type appears - * in the document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); - parent::__construct($data); - } - - /** - * The name of the property. Follows the same guidelines as the - * EntityType name. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the property. Follows the same guidelines as the - * EntityType name. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User defined name for the property. - * - * Generated from protobuf field string display_name = 6; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User defined name for the property. - * - * Generated from protobuf field string display_name = 6; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * A reference to the value type of the property. This type is subject - * to the same conventions as the `Entity.base_types` field. - * - * Generated from protobuf field string value_type = 2; - * @return string - */ - public function getValueType() - { - return $this->value_type; - } - - /** - * A reference to the value type of the property. This type is subject - * to the same conventions as the `Entity.base_types` field. - * - * Generated from protobuf field string value_type = 2; - * @param string $var - * @return $this - */ - public function setValueType($var) - { - GPBUtil::checkString($var, True); - $this->value_type = $var; - - return $this; - } - - /** - * Occurrence type limits the number of instances an entity type appears - * in the document. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; - * @return int - */ - public function getOccurrenceType() - { - return $this->occurrence_type; - } - - /** - * Occurrence type limits the number of instances an entity type appears - * in the document. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType occurrence_type = 3; - * @param int $var - * @return $this - */ - public function setOccurrenceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property\OccurrenceType::class); - $this->occurrence_type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Property::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_EntityType_Property::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property/OccurrenceType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property/OccurrenceType.php deleted file mode 100644 index 18ae968b954a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/EntityType/Property/OccurrenceType.php +++ /dev/null @@ -1,88 +0,0 @@ -google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType - */ -class OccurrenceType -{ - /** - * Unspecified occurrence type. - * - * Generated from protobuf enum OCCURRENCE_TYPE_UNSPECIFIED = 0; - */ - const OCCURRENCE_TYPE_UNSPECIFIED = 0; - /** - * There will be zero or one instance of this entity type. The same - * entity instance may be mentioned multiple times. - * - * Generated from protobuf enum OPTIONAL_ONCE = 1; - */ - const OPTIONAL_ONCE = 1; - /** - * The entity type will appear zero or multiple times. - * - * Generated from protobuf enum OPTIONAL_MULTIPLE = 2; - */ - const OPTIONAL_MULTIPLE = 2; - /** - * The entity type will only appear exactly once. The same - * entity instance may be mentioned multiple times. - * - * Generated from protobuf enum REQUIRED_ONCE = 3; - */ - const REQUIRED_ONCE = 3; - /** - * The entity type will appear once or more times. - * - * Generated from protobuf enum REQUIRED_MULTIPLE = 4; - */ - const REQUIRED_MULTIPLE = 4; - - private static $valueToName = [ - self::OCCURRENCE_TYPE_UNSPECIFIED => 'OCCURRENCE_TYPE_UNSPECIFIED', - self::OPTIONAL_ONCE => 'OPTIONAL_ONCE', - self::OPTIONAL_MULTIPLE => 'OPTIONAL_MULTIPLE', - self::REQUIRED_ONCE => 'REQUIRED_ONCE', - self::REQUIRED_MULTIPLE => 'REQUIRED_MULTIPLE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(OccurrenceType::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_EntityType_Property_OccurrenceType::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/Metadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/Metadata.php deleted file mode 100644 index a7906306349a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/DocumentSchema/Metadata.php +++ /dev/null @@ -1,192 +0,0 @@ -google.cloud.documentai.v1.DocumentSchema.Metadata - */ -class Metadata extends \Google\Protobuf\Internal\Message -{ - /** - * If true, a `document` entity type can be applied to subdocument - * (splitting). Otherwise, it can only be applied to the entire document - * (classification). - * - * Generated from protobuf field bool document_splitter = 1; - */ - protected $document_splitter = false; - /** - * If true, on a given page, there can be multiple `document` annotations - * covering it. - * - * Generated from protobuf field bool document_allow_multiple_labels = 2; - */ - protected $document_allow_multiple_labels = false; - /** - * If set, all the nested entities must be prefixed with the parents. - * - * Generated from protobuf field bool prefixed_naming_on_properties = 6; - */ - protected $prefixed_naming_on_properties = false; - /** - * If set, we will skip the naming format validation in the schema. So the - * string values in `DocumentSchema.EntityType.name` and - * `DocumentSchema.EntityType.Property.name` will not be checked. - * - * Generated from protobuf field bool skip_naming_validation = 7; - */ - protected $skip_naming_validation = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $document_splitter - * If true, a `document` entity type can be applied to subdocument - * (splitting). Otherwise, it can only be applied to the entire document - * (classification). - * @type bool $document_allow_multiple_labels - * If true, on a given page, there can be multiple `document` annotations - * covering it. - * @type bool $prefixed_naming_on_properties - * If set, all the nested entities must be prefixed with the parents. - * @type bool $skip_naming_validation - * If set, we will skip the naming format validation in the schema. So the - * string values in `DocumentSchema.EntityType.name` and - * `DocumentSchema.EntityType.Property.name` will not be checked. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce(); - parent::__construct($data); - } - - /** - * If true, a `document` entity type can be applied to subdocument - * (splitting). Otherwise, it can only be applied to the entire document - * (classification). - * - * Generated from protobuf field bool document_splitter = 1; - * @return bool - */ - public function getDocumentSplitter() - { - return $this->document_splitter; - } - - /** - * If true, a `document` entity type can be applied to subdocument - * (splitting). Otherwise, it can only be applied to the entire document - * (classification). - * - * Generated from protobuf field bool document_splitter = 1; - * @param bool $var - * @return $this - */ - public function setDocumentSplitter($var) - { - GPBUtil::checkBool($var); - $this->document_splitter = $var; - - return $this; - } - - /** - * If true, on a given page, there can be multiple `document` annotations - * covering it. - * - * Generated from protobuf field bool document_allow_multiple_labels = 2; - * @return bool - */ - public function getDocumentAllowMultipleLabels() - { - return $this->document_allow_multiple_labels; - } - - /** - * If true, on a given page, there can be multiple `document` annotations - * covering it. - * - * Generated from protobuf field bool document_allow_multiple_labels = 2; - * @param bool $var - * @return $this - */ - public function setDocumentAllowMultipleLabels($var) - { - GPBUtil::checkBool($var); - $this->document_allow_multiple_labels = $var; - - return $this; - } - - /** - * If set, all the nested entities must be prefixed with the parents. - * - * Generated from protobuf field bool prefixed_naming_on_properties = 6; - * @return bool - */ - public function getPrefixedNamingOnProperties() - { - return $this->prefixed_naming_on_properties; - } - - /** - * If set, all the nested entities must be prefixed with the parents. - * - * Generated from protobuf field bool prefixed_naming_on_properties = 6; - * @param bool $var - * @return $this - */ - public function setPrefixedNamingOnProperties($var) - { - GPBUtil::checkBool($var); - $this->prefixed_naming_on_properties = $var; - - return $this; - } - - /** - * If set, we will skip the naming format validation in the schema. So the - * string values in `DocumentSchema.EntityType.name` and - * `DocumentSchema.EntityType.Property.name` will not be checked. - * - * Generated from protobuf field bool skip_naming_validation = 7; - * @return bool - */ - public function getSkipNamingValidation() - { - return $this->skip_naming_validation; - } - - /** - * If set, we will skip the naming format validation in the schema. So the - * string values in `DocumentSchema.EntityType.name` and - * `DocumentSchema.EntityType.Property.name` will not be checked. - * - * Generated from protobuf field bool skip_naming_validation = 7; - * @param bool $var - * @return $this - */ - public function setSkipNamingValidation($var) - { - GPBUtil::checkBool($var); - $this->skip_naming_validation = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Metadata::class, \Google\Cloud\DocumentAI\V1\DocumentSchema_Metadata::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorMetadata.php deleted file mode 100644 index dc3948aaae17..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorMetadata.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.documentai.v1.EnableProcessorMetadata - */ -class EnableProcessorMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - */ - protected $common_metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorRequest.php deleted file mode 100644 index 3e3a5c3e66b6..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorRequest.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.documentai.v1.EnableProcessorRequest - */ -class EnableProcessorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor resource name to be enabled. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor resource name to be enabled. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor resource name to be enabled. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor resource name to be enabled. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorResponse.php deleted file mode 100644 index 573c89ac5fa2..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EnableProcessorResponse.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.documentai.v1.EnableProcessorResponse - */ -class EnableProcessorResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionMetadata.php deleted file mode 100644 index 4ac915145e9d..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionMetadata.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - */ -class EvaluateProcessorVersionMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - */ - protected $common_metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionRequest.php deleted file mode 100644 index 3cada6bf65f7..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionRequest.php +++ /dev/null @@ -1,146 +0,0 @@ -google.cloud.documentai.v1.EvaluateProcessorVersionRequest - */ -class EvaluateProcessorVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $processor_version = ''; - /** - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $evaluation_documents = null; - - /** - * @param string $processorVersion Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\EvaluateProcessorVersionRequest - * - * @experimental - */ - public static function build(string $processorVersion): self - { - return (new self()) - ->setProcessorVersion($processorVersion); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $processor_version - * Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $evaluation_documents - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProcessorVersion() - { - return $this->processor_version; - } - - /** - * Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string processor_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProcessorVersion($var) - { - GPBUtil::checkString($var, True); - $this->processor_version = $var; - - return $this; - } - - /** - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null - */ - public function getEvaluationDocuments() - { - return $this->evaluation_documents; - } - - public function hasEvaluationDocuments() - { - return isset($this->evaluation_documents); - } - - public function clearEvaluationDocuments() - { - unset($this->evaluation_documents); - } - - /** - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig evaluation_documents = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var - * @return $this - */ - public function setEvaluationDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig::class); - $this->evaluation_documents = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionResponse.php deleted file mode 100644 index df4d38b40cde..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluateProcessorVersionResponse.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.documentai.v1.EvaluateProcessorVersionResponse - */ -class EvaluateProcessorVersionResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the created evaluation. - * - * Generated from protobuf field string evaluation = 2; - */ - protected $evaluation = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $evaluation - * The resource name of the created evaluation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the created evaluation. - * - * Generated from protobuf field string evaluation = 2; - * @return string - */ - public function getEvaluation() - { - return $this->evaluation; - } - - /** - * The resource name of the created evaluation. - * - * Generated from protobuf field string evaluation = 2; - * @param string $var - * @return $this - */ - public function setEvaluation($var) - { - GPBUtil::checkString($var, True); - $this->evaluation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation.php deleted file mode 100644 index 7c1964f147c9..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation.php +++ /dev/null @@ -1,309 +0,0 @@ -google.cloud.documentai.v1.Evaluation - */ -class Evaluation extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the evaluation. - * Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The time that the evaluation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - protected $create_time = null; - /** - * Counters for the documents used in the evaluation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; - */ - protected $document_counters = null; - /** - * Metrics for all the entities in aggregate. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; - */ - protected $all_entities_metrics = null; - /** - * Metrics across confidence levels, for different entities. - * - * Generated from protobuf field map entity_metrics = 4; - */ - private $entity_metrics; - /** - * The KMS key name used for encryption. - * - * Generated from protobuf field string kms_key_name = 6; - */ - protected $kms_key_name = ''; - /** - * The KMS key version with which data is encrypted. - * - * Generated from protobuf field string kms_key_version_name = 7; - */ - protected $kms_key_version_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the evaluation. - * Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - * @type \Google\Protobuf\Timestamp $create_time - * The time that the evaluation was created. - * @type \Google\Cloud\DocumentAI\V1\Evaluation\Counters $document_counters - * Counters for the documents used in the evaluation. - * @type \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics $all_entities_metrics - * Metrics for all the entities in aggregate. - * @type array|\Google\Protobuf\Internal\MapField $entity_metrics - * Metrics across confidence levels, for different entities. - * @type string $kms_key_name - * The KMS key name used for encryption. - * @type string $kms_key_version_name - * The KMS key version with which data is encrypted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the evaluation. - * Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the evaluation. - * Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The time that the evaluation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time that the evaluation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Counters for the documents used in the evaluation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; - * @return \Google\Cloud\DocumentAI\V1\Evaluation\Counters|null - */ - public function getDocumentCounters() - { - return $this->document_counters; - } - - public function hasDocumentCounters() - { - return isset($this->document_counters); - } - - public function clearDocumentCounters() - { - unset($this->document_counters); - } - - /** - * Counters for the documents used in the evaluation. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Counters document_counters = 5; - * @param \Google\Cloud\DocumentAI\V1\Evaluation\Counters $var - * @return $this - */ - public function setDocumentCounters($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Counters::class); - $this->document_counters = $var; - - return $this; - } - - /** - * Metrics for all the entities in aggregate. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; - * @return \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics|null - */ - public function getAllEntitiesMetrics() - { - return $this->all_entities_metrics; - } - - public function hasAllEntitiesMetrics() - { - return isset($this->all_entities_metrics); - } - - public function clearAllEntitiesMetrics() - { - unset($this->all_entities_metrics); - } - - /** - * Metrics for all the entities in aggregate. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics all_entities_metrics = 3; - * @param \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics $var - * @return $this - */ - public function setAllEntitiesMetrics($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics::class); - $this->all_entities_metrics = $var; - - return $this; - } - - /** - * Metrics across confidence levels, for different entities. - * - * Generated from protobuf field map entity_metrics = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getEntityMetrics() - { - return $this->entity_metrics; - } - - /** - * Metrics across confidence levels, for different entities. - * - * Generated from protobuf field map entity_metrics = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setEntityMetrics($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics::class); - $this->entity_metrics = $arr; - - return $this; - } - - /** - * The KMS key name used for encryption. - * - * Generated from protobuf field string kms_key_name = 6; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The KMS key name used for encryption. - * - * Generated from protobuf field string kms_key_name = 6; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * The KMS key version with which data is encrypted. - * - * Generated from protobuf field string kms_key_version_name = 7; - * @return string - */ - public function getKmsKeyVersionName() - { - return $this->kms_key_version_name; - } - - /** - * The KMS key version with which data is encrypted. - * - * Generated from protobuf field string kms_key_version_name = 7; - * @param string $var - * @return $this - */ - public function setKmsKeyVersionName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_version_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/ConfidenceLevelMetrics.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/ConfidenceLevelMetrics.php deleted file mode 100644 index 41905bc2b7ff..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/ConfidenceLevelMetrics.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - */ -class ConfidenceLevelMetrics extends \Google\Protobuf\Internal\Message -{ - /** - * The confidence level. - * - * Generated from protobuf field float confidence_level = 1; - */ - protected $confidence_level = 0.0; - /** - * The metrics at the specific confidence level. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; - */ - protected $metrics = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $confidence_level - * The confidence level. - * @type \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $metrics - * The metrics at the specific confidence level. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); - parent::__construct($data); - } - - /** - * The confidence level. - * - * Generated from protobuf field float confidence_level = 1; - * @return float - */ - public function getConfidenceLevel() - { - return $this->confidence_level; - } - - /** - * The confidence level. - * - * Generated from protobuf field float confidence_level = 1; - * @param float $var - * @return $this - */ - public function setConfidenceLevel($var) - { - GPBUtil::checkFloat($var); - $this->confidence_level = $var; - - return $this; - } - - /** - * The metrics at the specific confidence level. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; - * @return \Google\Cloud\DocumentAI\V1\Evaluation\Metrics|null - */ - public function getMetrics() - { - return $this->metrics; - } - - public function hasMetrics() - { - return isset($this->metrics); - } - - public function clearMetrics() - { - unset($this->metrics); - } - - /** - * The metrics at the specific confidence level. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics metrics = 2; - * @param \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $var - * @return $this - */ - public function setMetrics($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Metrics::class); - $this->metrics = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConfidenceLevelMetrics::class, \Google\Cloud\DocumentAI\V1\Evaluation_ConfidenceLevelMetrics::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Counters.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Counters.php deleted file mode 100644 index 525a04970600..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Counters.php +++ /dev/null @@ -1,180 +0,0 @@ -google.cloud.documentai.v1.Evaluation.Counters - */ -class Counters extends \Google\Protobuf\Internal\Message -{ - /** - * How many documents were sent for evaluation. - * - * Generated from protobuf field int32 input_documents_count = 1; - */ - protected $input_documents_count = 0; - /** - * How many documents were not included in the evaluation as they didn't - * pass validation. - * - * Generated from protobuf field int32 invalid_documents_count = 2; - */ - protected $invalid_documents_count = 0; - /** - * How many documents were not included in the evaluation as Document AI - * failed to process them. - * - * Generated from protobuf field int32 failed_documents_count = 3; - */ - protected $failed_documents_count = 0; - /** - * How many documents were used in the evaluation. - * - * Generated from protobuf field int32 evaluated_documents_count = 4; - */ - protected $evaluated_documents_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $input_documents_count - * How many documents were sent for evaluation. - * @type int $invalid_documents_count - * How many documents were not included in the evaluation as they didn't - * pass validation. - * @type int $failed_documents_count - * How many documents were not included in the evaluation as Document AI - * failed to process them. - * @type int $evaluated_documents_count - * How many documents were used in the evaluation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); - parent::__construct($data); - } - - /** - * How many documents were sent for evaluation. - * - * Generated from protobuf field int32 input_documents_count = 1; - * @return int - */ - public function getInputDocumentsCount() - { - return $this->input_documents_count; - } - - /** - * How many documents were sent for evaluation. - * - * Generated from protobuf field int32 input_documents_count = 1; - * @param int $var - * @return $this - */ - public function setInputDocumentsCount($var) - { - GPBUtil::checkInt32($var); - $this->input_documents_count = $var; - - return $this; - } - - /** - * How many documents were not included in the evaluation as they didn't - * pass validation. - * - * Generated from protobuf field int32 invalid_documents_count = 2; - * @return int - */ - public function getInvalidDocumentsCount() - { - return $this->invalid_documents_count; - } - - /** - * How many documents were not included in the evaluation as they didn't - * pass validation. - * - * Generated from protobuf field int32 invalid_documents_count = 2; - * @param int $var - * @return $this - */ - public function setInvalidDocumentsCount($var) - { - GPBUtil::checkInt32($var); - $this->invalid_documents_count = $var; - - return $this; - } - - /** - * How many documents were not included in the evaluation as Document AI - * failed to process them. - * - * Generated from protobuf field int32 failed_documents_count = 3; - * @return int - */ - public function getFailedDocumentsCount() - { - return $this->failed_documents_count; - } - - /** - * How many documents were not included in the evaluation as Document AI - * failed to process them. - * - * Generated from protobuf field int32 failed_documents_count = 3; - * @param int $var - * @return $this - */ - public function setFailedDocumentsCount($var) - { - GPBUtil::checkInt32($var); - $this->failed_documents_count = $var; - - return $this; - } - - /** - * How many documents were used in the evaluation. - * - * Generated from protobuf field int32 evaluated_documents_count = 4; - * @return int - */ - public function getEvaluatedDocumentsCount() - { - return $this->evaluated_documents_count; - } - - /** - * How many documents were used in the evaluation. - * - * Generated from protobuf field int32 evaluated_documents_count = 4; - * @param int $var - * @return $this - */ - public function setEvaluatedDocumentsCount($var) - { - GPBUtil::checkInt32($var); - $this->evaluated_documents_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Counters::class, \Google\Cloud\DocumentAI\V1\Evaluation_Counters::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Metrics.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Metrics.php deleted file mode 100644 index daf92a7fb96a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/Metrics.php +++ /dev/null @@ -1,410 +0,0 @@ -google.cloud.documentai.v1.Evaluation.Metrics - */ -class Metrics extends \Google\Protobuf\Internal\Message -{ - /** - * The calculated precision. - * - * Generated from protobuf field float precision = 1; - */ - protected $precision = 0.0; - /** - * The calculated recall. - * - * Generated from protobuf field float recall = 2; - */ - protected $recall = 0.0; - /** - * The calculated f1 score. - * - * Generated from protobuf field float f1_score = 3; - */ - protected $f1_score = 0.0; - /** - * The amount of occurrences in predicted documents. - * - * Generated from protobuf field int32 predicted_occurrences_count = 4; - */ - protected $predicted_occurrences_count = 0; - /** - * The amount of occurrences in ground truth documents. - * - * Generated from protobuf field int32 ground_truth_occurrences_count = 5; - */ - protected $ground_truth_occurrences_count = 0; - /** - * The amount of documents with a predicted occurrence. - * - * Generated from protobuf field int32 predicted_document_count = 10; - */ - protected $predicted_document_count = 0; - /** - * The amount of documents with a ground truth occurrence. - * - * Generated from protobuf field int32 ground_truth_document_count = 11; - */ - protected $ground_truth_document_count = 0; - /** - * The amount of true positives. - * - * Generated from protobuf field int32 true_positives_count = 6; - */ - protected $true_positives_count = 0; - /** - * The amount of false positives. - * - * Generated from protobuf field int32 false_positives_count = 7; - */ - protected $false_positives_count = 0; - /** - * The amount of false negatives. - * - * Generated from protobuf field int32 false_negatives_count = 8; - */ - protected $false_negatives_count = 0; - /** - * The amount of documents that had an occurrence of this label. - * - * Generated from protobuf field int32 total_documents_count = 9; - */ - protected $total_documents_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $precision - * The calculated precision. - * @type float $recall - * The calculated recall. - * @type float $f1_score - * The calculated f1 score. - * @type int $predicted_occurrences_count - * The amount of occurrences in predicted documents. - * @type int $ground_truth_occurrences_count - * The amount of occurrences in ground truth documents. - * @type int $predicted_document_count - * The amount of documents with a predicted occurrence. - * @type int $ground_truth_document_count - * The amount of documents with a ground truth occurrence. - * @type int $true_positives_count - * The amount of true positives. - * @type int $false_positives_count - * The amount of false positives. - * @type int $false_negatives_count - * The amount of false negatives. - * @type int $total_documents_count - * The amount of documents that had an occurrence of this label. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); - parent::__construct($data); - } - - /** - * The calculated precision. - * - * Generated from protobuf field float precision = 1; - * @return float - */ - public function getPrecision() - { - return $this->precision; - } - - /** - * The calculated precision. - * - * Generated from protobuf field float precision = 1; - * @param float $var - * @return $this - */ - public function setPrecision($var) - { - GPBUtil::checkFloat($var); - $this->precision = $var; - - return $this; - } - - /** - * The calculated recall. - * - * Generated from protobuf field float recall = 2; - * @return float - */ - public function getRecall() - { - return $this->recall; - } - - /** - * The calculated recall. - * - * Generated from protobuf field float recall = 2; - * @param float $var - * @return $this - */ - public function setRecall($var) - { - GPBUtil::checkFloat($var); - $this->recall = $var; - - return $this; - } - - /** - * The calculated f1 score. - * - * Generated from protobuf field float f1_score = 3; - * @return float - */ - public function getF1Score() - { - return $this->f1_score; - } - - /** - * The calculated f1 score. - * - * Generated from protobuf field float f1_score = 3; - * @param float $var - * @return $this - */ - public function setF1Score($var) - { - GPBUtil::checkFloat($var); - $this->f1_score = $var; - - return $this; - } - - /** - * The amount of occurrences in predicted documents. - * - * Generated from protobuf field int32 predicted_occurrences_count = 4; - * @return int - */ - public function getPredictedOccurrencesCount() - { - return $this->predicted_occurrences_count; - } - - /** - * The amount of occurrences in predicted documents. - * - * Generated from protobuf field int32 predicted_occurrences_count = 4; - * @param int $var - * @return $this - */ - public function setPredictedOccurrencesCount($var) - { - GPBUtil::checkInt32($var); - $this->predicted_occurrences_count = $var; - - return $this; - } - - /** - * The amount of occurrences in ground truth documents. - * - * Generated from protobuf field int32 ground_truth_occurrences_count = 5; - * @return int - */ - public function getGroundTruthOccurrencesCount() - { - return $this->ground_truth_occurrences_count; - } - - /** - * The amount of occurrences in ground truth documents. - * - * Generated from protobuf field int32 ground_truth_occurrences_count = 5; - * @param int $var - * @return $this - */ - public function setGroundTruthOccurrencesCount($var) - { - GPBUtil::checkInt32($var); - $this->ground_truth_occurrences_count = $var; - - return $this; - } - - /** - * The amount of documents with a predicted occurrence. - * - * Generated from protobuf field int32 predicted_document_count = 10; - * @return int - */ - public function getPredictedDocumentCount() - { - return $this->predicted_document_count; - } - - /** - * The amount of documents with a predicted occurrence. - * - * Generated from protobuf field int32 predicted_document_count = 10; - * @param int $var - * @return $this - */ - public function setPredictedDocumentCount($var) - { - GPBUtil::checkInt32($var); - $this->predicted_document_count = $var; - - return $this; - } - - /** - * The amount of documents with a ground truth occurrence. - * - * Generated from protobuf field int32 ground_truth_document_count = 11; - * @return int - */ - public function getGroundTruthDocumentCount() - { - return $this->ground_truth_document_count; - } - - /** - * The amount of documents with a ground truth occurrence. - * - * Generated from protobuf field int32 ground_truth_document_count = 11; - * @param int $var - * @return $this - */ - public function setGroundTruthDocumentCount($var) - { - GPBUtil::checkInt32($var); - $this->ground_truth_document_count = $var; - - return $this; - } - - /** - * The amount of true positives. - * - * Generated from protobuf field int32 true_positives_count = 6; - * @return int - */ - public function getTruePositivesCount() - { - return $this->true_positives_count; - } - - /** - * The amount of true positives. - * - * Generated from protobuf field int32 true_positives_count = 6; - * @param int $var - * @return $this - */ - public function setTruePositivesCount($var) - { - GPBUtil::checkInt32($var); - $this->true_positives_count = $var; - - return $this; - } - - /** - * The amount of false positives. - * - * Generated from protobuf field int32 false_positives_count = 7; - * @return int - */ - public function getFalsePositivesCount() - { - return $this->false_positives_count; - } - - /** - * The amount of false positives. - * - * Generated from protobuf field int32 false_positives_count = 7; - * @param int $var - * @return $this - */ - public function setFalsePositivesCount($var) - { - GPBUtil::checkInt32($var); - $this->false_positives_count = $var; - - return $this; - } - - /** - * The amount of false negatives. - * - * Generated from protobuf field int32 false_negatives_count = 8; - * @return int - */ - public function getFalseNegativesCount() - { - return $this->false_negatives_count; - } - - /** - * The amount of false negatives. - * - * Generated from protobuf field int32 false_negatives_count = 8; - * @param int $var - * @return $this - */ - public function setFalseNegativesCount($var) - { - GPBUtil::checkInt32($var); - $this->false_negatives_count = $var; - - return $this; - } - - /** - * The amount of documents that had an occurrence of this label. - * - * Generated from protobuf field int32 total_documents_count = 9; - * @return int - */ - public function getTotalDocumentsCount() - { - return $this->total_documents_count; - } - - /** - * The amount of documents that had an occurrence of this label. - * - * Generated from protobuf field int32 total_documents_count = 9; - * @param int $var - * @return $this - */ - public function setTotalDocumentsCount($var) - { - GPBUtil::checkInt32($var); - $this->total_documents_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Metrics::class, \Google\Cloud\DocumentAI\V1\Evaluation_Metrics::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics.php deleted file mode 100644 index 5fddfea94ab2..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics.php +++ /dev/null @@ -1,290 +0,0 @@ -google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - */ -class MultiConfidenceMetrics extends \Google\Protobuf\Internal\Message -{ - /** - * Metrics across confidence levels with fuzzy matching enabled. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; - */ - private $confidence_level_metrics; - /** - * Metrics across confidence levels with only exact matching. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; - */ - private $confidence_level_metrics_exact; - /** - * The calculated area under the precision recall curve (AUPRC), computed by - * integrating over all confidence thresholds. - * - * Generated from protobuf field float auprc = 2; - */ - protected $auprc = 0.0; - /** - * The Estimated Calibration Error (ECE) of the confidence of the predicted - * entities. - * - * Generated from protobuf field float estimated_calibration_error = 3; - */ - protected $estimated_calibration_error = 0.0; - /** - * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching - * only. - * - * Generated from protobuf field float auprc_exact = 5; - */ - protected $auprc_exact = 0.0; - /** - * The ECE for the predicted entities with fuzzy matching disabled, i.e., - * exact matching only. - * - * Generated from protobuf field float estimated_calibration_error_exact = 6; - */ - protected $estimated_calibration_error_exact = 0.0; - /** - * The metrics type for the label. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; - */ - protected $metrics_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics>|\Google\Protobuf\Internal\RepeatedField $confidence_level_metrics - * Metrics across confidence levels with fuzzy matching enabled. - * @type array<\Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics>|\Google\Protobuf\Internal\RepeatedField $confidence_level_metrics_exact - * Metrics across confidence levels with only exact matching. - * @type float $auprc - * The calculated area under the precision recall curve (AUPRC), computed by - * integrating over all confidence thresholds. - * @type float $estimated_calibration_error - * The Estimated Calibration Error (ECE) of the confidence of the predicted - * entities. - * @type float $auprc_exact - * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching - * only. - * @type float $estimated_calibration_error_exact - * The ECE for the predicted entities with fuzzy matching disabled, i.e., - * exact matching only. - * @type int $metrics_type - * The metrics type for the label. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); - parent::__construct($data); - } - - /** - * Metrics across confidence levels with fuzzy matching enabled. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConfidenceLevelMetrics() - { - return $this->confidence_level_metrics; - } - - /** - * Metrics across confidence levels with fuzzy matching enabled. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConfidenceLevelMetrics($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics::class); - $this->confidence_level_metrics = $arr; - - return $this; - } - - /** - * Metrics across confidence levels with only exact matching. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConfidenceLevelMetricsExact() - { - return $this->confidence_level_metrics_exact; - } - - /** - * Metrics across confidence levels with only exact matching. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics confidence_level_metrics_exact = 4; - * @param array<\Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConfidenceLevelMetricsExact($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Evaluation\ConfidenceLevelMetrics::class); - $this->confidence_level_metrics_exact = $arr; - - return $this; - } - - /** - * The calculated area under the precision recall curve (AUPRC), computed by - * integrating over all confidence thresholds. - * - * Generated from protobuf field float auprc = 2; - * @return float - */ - public function getAuprc() - { - return $this->auprc; - } - - /** - * The calculated area under the precision recall curve (AUPRC), computed by - * integrating over all confidence thresholds. - * - * Generated from protobuf field float auprc = 2; - * @param float $var - * @return $this - */ - public function setAuprc($var) - { - GPBUtil::checkFloat($var); - $this->auprc = $var; - - return $this; - } - - /** - * The Estimated Calibration Error (ECE) of the confidence of the predicted - * entities. - * - * Generated from protobuf field float estimated_calibration_error = 3; - * @return float - */ - public function getEstimatedCalibrationError() - { - return $this->estimated_calibration_error; - } - - /** - * The Estimated Calibration Error (ECE) of the confidence of the predicted - * entities. - * - * Generated from protobuf field float estimated_calibration_error = 3; - * @param float $var - * @return $this - */ - public function setEstimatedCalibrationError($var) - { - GPBUtil::checkFloat($var); - $this->estimated_calibration_error = $var; - - return $this; - } - - /** - * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching - * only. - * - * Generated from protobuf field float auprc_exact = 5; - * @return float - */ - public function getAuprcExact() - { - return $this->auprc_exact; - } - - /** - * The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching - * only. - * - * Generated from protobuf field float auprc_exact = 5; - * @param float $var - * @return $this - */ - public function setAuprcExact($var) - { - GPBUtil::checkFloat($var); - $this->auprc_exact = $var; - - return $this; - } - - /** - * The ECE for the predicted entities with fuzzy matching disabled, i.e., - * exact matching only. - * - * Generated from protobuf field float estimated_calibration_error_exact = 6; - * @return float - */ - public function getEstimatedCalibrationErrorExact() - { - return $this->estimated_calibration_error_exact; - } - - /** - * The ECE for the predicted entities with fuzzy matching disabled, i.e., - * exact matching only. - * - * Generated from protobuf field float estimated_calibration_error_exact = 6; - * @param float $var - * @return $this - */ - public function setEstimatedCalibrationErrorExact($var) - { - GPBUtil::checkFloat($var); - $this->estimated_calibration_error_exact = $var; - - return $this; - } - - /** - * The metrics type for the label. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; - * @return int - */ - public function getMetricsType() - { - return $this->metrics_type; - } - - /** - * The metrics type for the label. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType metrics_type = 7; - * @param int $var - * @return $this - */ - public function setMetricsType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Evaluation\MultiConfidenceMetrics\MetricsType::class); - $this->metrics_type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MultiConfidenceMetrics::class, \Google\Cloud\DocumentAI\V1\Evaluation_MultiConfidenceMetrics::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php deleted file mode 100644 index d48051e88622..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Evaluation/MultiConfidenceMetrics/MetricsType.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType - */ -class MetricsType -{ - /** - * The metrics type is unspecified. By default, metrics without a - * particular specification are for leaf entity types (i.e., top-level - * entity types without child types, or child types which are not - * parent types themselves). - * - * Generated from protobuf enum METRICS_TYPE_UNSPECIFIED = 0; - */ - const METRICS_TYPE_UNSPECIFIED = 0; - /** - * Indicates whether metrics for this particular label type represent an - * aggregate of metrics for other types instead of being based on actual - * TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) - * entity types are an aggregate of metrics for their children. - * - * Generated from protobuf enum AGGREGATE = 1; - */ - const AGGREGATE = 1; - - private static $valueToName = [ - self::METRICS_TYPE_UNSPECIFIED => 'METRICS_TYPE_UNSPECIFIED', - self::AGGREGATE => 'AGGREGATE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetricsType::class, \Google\Cloud\DocumentAI\V1\Evaluation_MultiConfidenceMetrics_MetricsType::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluationReference.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluationReference.php deleted file mode 100644 index 4e86a056e7f1..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/EvaluationReference.php +++ /dev/null @@ -1,189 +0,0 @@ -google.cloud.documentai.v1.EvaluationReference - */ -class EvaluationReference extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the Long Running Operation for the evaluation. - * - * Generated from protobuf field string operation = 1; - */ - protected $operation = ''; - /** - * The resource name of the evaluation. - * - * Generated from protobuf field string evaluation = 2 [(.google.api.resource_reference) = { - */ - protected $evaluation = ''; - /** - * An aggregate of the statistics for the evaluation with fuzzy matching on. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; - */ - protected $aggregate_metrics = null; - /** - * An aggregate of the statistics for the evaluation with fuzzy matching off. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; - */ - protected $aggregate_metrics_exact = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $operation - * The resource name of the Long Running Operation for the evaluation. - * @type string $evaluation - * The resource name of the evaluation. - * @type \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $aggregate_metrics - * An aggregate of the statistics for the evaluation with fuzzy matching on. - * @type \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $aggregate_metrics_exact - * An aggregate of the statistics for the evaluation with fuzzy matching off. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Evaluation::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the Long Running Operation for the evaluation. - * - * Generated from protobuf field string operation = 1; - * @return string - */ - public function getOperation() - { - return $this->operation; - } - - /** - * The resource name of the Long Running Operation for the evaluation. - * - * Generated from protobuf field string operation = 1; - * @param string $var - * @return $this - */ - public function setOperation($var) - { - GPBUtil::checkString($var, True); - $this->operation = $var; - - return $this; - } - - /** - * The resource name of the evaluation. - * - * Generated from protobuf field string evaluation = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getEvaluation() - { - return $this->evaluation; - } - - /** - * The resource name of the evaluation. - * - * Generated from protobuf field string evaluation = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setEvaluation($var) - { - GPBUtil::checkString($var, True); - $this->evaluation = $var; - - return $this; - } - - /** - * An aggregate of the statistics for the evaluation with fuzzy matching on. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; - * @return \Google\Cloud\DocumentAI\V1\Evaluation\Metrics|null - */ - public function getAggregateMetrics() - { - return $this->aggregate_metrics; - } - - public function hasAggregateMetrics() - { - return isset($this->aggregate_metrics); - } - - public function clearAggregateMetrics() - { - unset($this->aggregate_metrics); - } - - /** - * An aggregate of the statistics for the evaluation with fuzzy matching on. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics = 4; - * @param \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $var - * @return $this - */ - public function setAggregateMetrics($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Metrics::class); - $this->aggregate_metrics = $var; - - return $this; - } - - /** - * An aggregate of the statistics for the evaluation with fuzzy matching off. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; - * @return \Google\Cloud\DocumentAI\V1\Evaluation\Metrics|null - */ - public function getAggregateMetricsExact() - { - return $this->aggregate_metrics_exact; - } - - public function hasAggregateMetricsExact() - { - return isset($this->aggregate_metrics_exact); - } - - public function clearAggregateMetricsExact() - { - unset($this->aggregate_metrics_exact); - } - - /** - * An aggregate of the statistics for the evaluation with fuzzy matching off. - * - * Generated from protobuf field .google.cloud.documentai.v1.Evaluation.Metrics aggregate_metrics_exact = 5; - * @param \Google\Cloud\DocumentAI\V1\Evaluation\Metrics $var - * @return $this - */ - public function setAggregateMetricsExact($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Evaluation\Metrics::class); - $this->aggregate_metrics_exact = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesRequest.php deleted file mode 100644 index f16e7109954b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesRequest.php +++ /dev/null @@ -1,89 +0,0 @@ -google.cloud.documentai.v1.FetchProcessorTypesRequest - */ -class FetchProcessorTypesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - - /** - * @param string $parent Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. Please see - * {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\FetchProcessorTypesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesResponse.php deleted file mode 100644 index dd5747eca369..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/FetchProcessorTypesResponse.php +++ /dev/null @@ -1,69 +0,0 @@ -google.cloud.documentai.v1.FetchProcessorTypesResponse - */ -class FetchProcessorTypesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of processor types. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; - */ - private $processor_types; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $processor_types - * The list of processor types. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The list of processor types. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProcessorTypes() - { - return $this->processor_types; - } - - /** - * The list of processor types. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; - * @param array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProcessorTypes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorType::class); - $this->processor_types = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocument.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocument.php deleted file mode 100644 index 29eb74b4cdad..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocument.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.documentai.v1.GcsDocument - */ -class GcsDocument extends \Google\Protobuf\Internal\Message -{ - /** - * The Cloud Storage object uri. - * - * Generated from protobuf field string gcs_uri = 1; - */ - protected $gcs_uri = ''; - /** - * An IANA MIME type (RFC6838) of the content. - * - * Generated from protobuf field string mime_type = 2; - */ - protected $mime_type = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $gcs_uri - * The Cloud Storage object uri. - * @type string $mime_type - * An IANA MIME type (RFC6838) of the content. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * The Cloud Storage object uri. - * - * Generated from protobuf field string gcs_uri = 1; - * @return string - */ - public function getGcsUri() - { - return $this->gcs_uri; - } - - /** - * The Cloud Storage object uri. - * - * Generated from protobuf field string gcs_uri = 1; - * @param string $var - * @return $this - */ - public function setGcsUri($var) - { - GPBUtil::checkString($var, True); - $this->gcs_uri = $var; - - return $this; - } - - /** - * An IANA MIME type (RFC6838) of the content. - * - * Generated from protobuf field string mime_type = 2; - * @return string - */ - public function getMimeType() - { - return $this->mime_type; - } - - /** - * An IANA MIME type (RFC6838) of the content. - * - * Generated from protobuf field string mime_type = 2; - * @param string $var - * @return $this - */ - public function setMimeType($var) - { - GPBUtil::checkString($var, True); - $this->mime_type = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocuments.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocuments.php deleted file mode 100644 index c23bdc383d2f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsDocuments.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.documentai.v1.GcsDocuments - */ -class GcsDocuments extends \Google\Protobuf\Internal\Message -{ - /** - * The list of documents. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; - */ - private $documents; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\GcsDocument>|\Google\Protobuf\Internal\RepeatedField $documents - * The list of documents. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * The list of documents. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDocuments() - { - return $this->documents; - } - - /** - * The list of documents. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.GcsDocument documents = 1; - * @param array<\Google\Cloud\DocumentAI\V1\GcsDocument>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDocuments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\GcsDocument::class); - $this->documents = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsPrefix.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsPrefix.php deleted file mode 100644 index 47f0c4f619e3..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GcsPrefix.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.documentai.v1.GcsPrefix - */ -class GcsPrefix extends \Google\Protobuf\Internal\Message -{ - /** - * The URI prefix. - * - * Generated from protobuf field string gcs_uri_prefix = 1; - */ - protected $gcs_uri_prefix = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $gcs_uri_prefix - * The URI prefix. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * The URI prefix. - * - * Generated from protobuf field string gcs_uri_prefix = 1; - * @return string - */ - public function getGcsUriPrefix() - { - return $this->gcs_uri_prefix; - } - - /** - * The URI prefix. - * - * Generated from protobuf field string gcs_uri_prefix = 1; - * @param string $var - * @return $this - */ - public function setGcsUriPrefix($var) - { - GPBUtil::checkString($var, True); - $this->gcs_uri_prefix = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetEvaluationRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetEvaluationRequest.php deleted file mode 100644 index 6f2655e51233..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetEvaluationRequest.php +++ /dev/null @@ -1,91 +0,0 @@ -google.cloud.documentai.v1.GetEvaluationRequest - */ -class GetEvaluationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The resource name of the - * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - * Please see {@see DocumentProcessorServiceClient::evaluationName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\GetEvaluationRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the - * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the - * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorRequest.php deleted file mode 100644 index 400d45124693..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.documentai.v1.GetProcessorRequest - */ -class GetProcessorRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The processor resource name. Please see - * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\GetProcessorRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor resource name. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorTypeRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorTypeRequest.php deleted file mode 100644 index 3ff3084db365..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorTypeRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.documentai.v1.GetProcessorTypeRequest - */ -class GetProcessorTypeRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor type resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The processor type resource name. Please see - * {@see DocumentProcessorServiceClient::processorTypeName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\GetProcessorTypeRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor type resource name. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor type resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor type resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorVersionRequest.php deleted file mode 100644 index 626c849fa822..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/GetProcessorVersionRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.documentai.v1.GetProcessorVersionRequest - */ -class GetProcessorVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The processor resource name. Please see - * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\GetProcessorVersionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor resource name. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor resource name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus.php deleted file mode 100644 index 7c7e15d95aac..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.documentai.v1.HumanReviewStatus - */ -class HumanReviewStatus extends \Google\Protobuf\Internal\Message -{ - /** - * The state of human review on the processing request. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus.State state = 1; - */ - protected $state = 0; - /** - * A message providing more details about the human review state. - * - * Generated from protobuf field string state_message = 2; - */ - protected $state_message = ''; - /** - * The name of the operation triggered by the processed document. This field - * is populated only when the - * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is - * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as - * the long-running operation returned by - * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. - * - * Generated from protobuf field string human_review_operation = 3; - */ - protected $human_review_operation = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The state of human review on the processing request. - * @type string $state_message - * A message providing more details about the human review state. - * @type string $human_review_operation - * The name of the operation triggered by the processed document. This field - * is populated only when the - * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is - * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as - * the long-running operation returned by - * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The state of human review on the processing request. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The state of human review on the processing request. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\HumanReviewStatus\State::class); - $this->state = $var; - - return $this; - } - - /** - * A message providing more details about the human review state. - * - * Generated from protobuf field string state_message = 2; - * @return string - */ - public function getStateMessage() - { - return $this->state_message; - } - - /** - * A message providing more details about the human review state. - * - * Generated from protobuf field string state_message = 2; - * @param string $var - * @return $this - */ - public function setStateMessage($var) - { - GPBUtil::checkString($var, True); - $this->state_message = $var; - - return $this; - } - - /** - * The name of the operation triggered by the processed document. This field - * is populated only when the - * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is - * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as - * the long-running operation returned by - * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. - * - * Generated from protobuf field string human_review_operation = 3; - * @return string - */ - public function getHumanReviewOperation() - { - return $this->human_review_operation; - } - - /** - * The name of the operation triggered by the processed document. This field - * is populated only when the - * [state][google.cloud.documentai.v1.HumanReviewStatus.state] is - * `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as - * the long-running operation returned by - * [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]. - * - * Generated from protobuf field string human_review_operation = 3; - * @param string $var - * @return $this - */ - public function setHumanReviewOperation($var) - { - GPBUtil::checkString($var, True); - $this->human_review_operation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus/State.php deleted file mode 100644 index 1c83b273fd8c..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/HumanReviewStatus/State.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.documentai.v1.HumanReviewStatus.State - */ -class State -{ - /** - * Human review state is unspecified. Most likely due to an internal error. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Human review is skipped for the document. This can happen because human - * review isn't enabled on the processor or the processing request has - * been set to skip this document. - * - * Generated from protobuf enum SKIPPED = 1; - */ - const SKIPPED = 1; - /** - * Human review validation is triggered and passed, so no review is needed. - * - * Generated from protobuf enum VALIDATION_PASSED = 2; - */ - const VALIDATION_PASSED = 2; - /** - * Human review validation is triggered and the document is under review. - * - * Generated from protobuf enum IN_PROGRESS = 3; - */ - const IN_PROGRESS = 3; - /** - * Some error happened during triggering human review, see the - * [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message] - * for details. - * - * Generated from protobuf enum ERROR = 4; - */ - const ERROR = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::SKIPPED => 'SKIPPED', - self::VALIDATION_PASSED => 'VALIDATION_PASSED', - self::IN_PROGRESS => 'IN_PROGRESS', - self::ERROR => 'ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\DocumentAI\V1\HumanReviewStatus_State::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsRequest.php deleted file mode 100644 index 807389a4e80c..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsRequest.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.documentai.v1.ListEvaluationsRequest - */ -class ListEvaluationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The standard list page size. - * If unspecified, at most `5` evaluations are returned. - * The maximum value is `100`. Values above `100` are coerced to `100`. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * Please see {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\ListEvaluationsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @type int $page_size - * The standard list page size. - * If unspecified, at most `5` evaluations are returned. - * The maximum value is `100`. Values above `100` are coerced to `100`. - * @type string $page_token - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The standard list page size. - * If unspecified, at most `5` evaluations are returned. - * The maximum value is `100`. Values above `100` are coerced to `100`. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The standard list page size. - * If unspecified, at most `5` evaluations are returned. - * The maximum value is `100`. Values above `100` are coerced to `100`. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsResponse.php deleted file mode 100644 index 50718a220119..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListEvaluationsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.documentai.v1.ListEvaluationsResponse - */ -class ListEvaluationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The evaluations requested. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; - */ - private $evaluations; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Evaluation>|\Google\Protobuf\Internal\RepeatedField $evaluations - * The evaluations requested. - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The evaluations requested. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEvaluations() - { - return $this->evaluations; - } - - /** - * The evaluations requested. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Evaluation evaluations = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Evaluation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEvaluations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Evaluation::class); - $this->evaluations = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesRequest.php deleted file mode 100644 index 8376d2a3fdbd..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesRequest.php +++ /dev/null @@ -1,165 +0,0 @@ -google.cloud.documentai.v1.ListProcessorTypesRequest - */ -class ListProcessorTypesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of processor types to return. - * If unspecified, at most `100` processor types will be returned. - * The maximum value is `500`. Values above `500` will be coerced to `500`. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * Used to retrieve the next page of results, empty if at the end of the list. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. Please see - * {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\ListProcessorTypesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @type int $page_size - * The maximum number of processor types to return. - * If unspecified, at most `100` processor types will be returned. - * The maximum value is `500`. Values above `500` will be coerced to `500`. - * @type string $page_token - * Used to retrieve the next page of results, empty if at the end of the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of processor types to return. - * If unspecified, at most `100` processor types will be returned. - * The maximum value is `500`. Values above `500` will be coerced to `500`. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of processor types to return. - * If unspecified, at most `100` processor types will be returned. - * The maximum value is `500`. Values above `500` will be coerced to `500`. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Used to retrieve the next page of results, empty if at the end of the list. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Used to retrieve the next page of results, empty if at the end of the list. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesResponse.php deleted file mode 100644 index 2ab8fbb8ffa7..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorTypesResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -google.cloud.documentai.v1.ListProcessorTypesResponse - */ -class ListProcessorTypesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The processor types. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; - */ - private $processor_types; - /** - * Points to the next page, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $processor_types - * The processor types. - * @type string $next_page_token - * Points to the next page, otherwise empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The processor types. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProcessorTypes() - { - return $this->processor_types; - } - - /** - * The processor types. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType processor_types = 1; - * @param array<\Google\Cloud\DocumentAI\V1\ProcessorType>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProcessorTypes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorType::class); - $this->processor_types = $arr; - - return $this; - } - - /** - * Points to the next page, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Points to the next page, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsRequest.php deleted file mode 100644 index 2eb32ebdb5cd..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsRequest.php +++ /dev/null @@ -1,171 +0,0 @@ -google.cloud.documentai.v1.ListProcessorVersionsRequest - */ -class ListProcessorVersionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of processor versions to return. - * If unspecified, at most `10` processor versions will be returned. - * The maximum value is `20`. Values above `20` will be coerced to `20`. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * Please see {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\ListProcessorVersionsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @type int $page_size - * The maximum number of processor versions to return. - * If unspecified, at most `10` processor versions will be returned. - * The maximum value is `20`. Values above `20` will be coerced to `20`. - * @type string $page_token - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of processor versions to return. - * If unspecified, at most `10` processor versions will be returned. - * The maximum value is `20`. Values above `20` will be coerced to `20`. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of processor versions to return. - * If unspecified, at most `10` processor versions will be returned. - * The maximum value is `20`. Values above `20` will be coerced to `20`. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsResponse.php deleted file mode 100644 index b5b6b73704e1..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorVersionsResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -google.cloud.documentai.v1.ListProcessorVersionsResponse - */ -class ListProcessorVersionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of processors. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; - */ - private $processor_versions; - /** - * Points to the next processor, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\ProcessorVersion>|\Google\Protobuf\Internal\RepeatedField $processor_versions - * The list of processors. - * @type string $next_page_token - * Points to the next processor, otherwise empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The list of processors. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProcessorVersions() - { - return $this->processor_versions; - } - - /** - * The list of processors. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersion processor_versions = 1; - * @param array<\Google\Cloud\DocumentAI\V1\ProcessorVersion>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProcessorVersions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorVersion::class); - $this->processor_versions = $arr; - - return $this; - } - - /** - * Points to the next processor, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Points to the next processor, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsRequest.php deleted file mode 100644 index 2b4335b85480..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsRequest.php +++ /dev/null @@ -1,166 +0,0 @@ -google.cloud.documentai.v1.ListProcessorsRequest - */ -class ListProcessorsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of processors to return. - * If unspecified, at most `50` processors will be returned. - * The maximum value is `100`. Values above `100` will be coerced to `100`. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * Please see {@see DocumentProcessorServiceClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\ListProcessorsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * @type int $page_size - * The maximum number of processors to return. - * If unspecified, at most `50` processors will be returned. - * The maximum value is `100`. Values above `100` will be coerced to `100`. - * @type string $page_token - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of processors to return. - * If unspecified, at most `50` processors will be returned. - * The maximum value is `100`. Values above `100` will be coerced to `100`. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of processors to return. - * If unspecified, at most `50` processors will be returned. - * The maximum value is `100`. Values above `100` will be coerced to `100`. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsResponse.php deleted file mode 100644 index c92d36758eb2..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ListProcessorsResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -google.cloud.documentai.v1.ListProcessorsResponse - */ -class ListProcessorsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of processors. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; - */ - private $processors; - /** - * Points to the next processor, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DocumentAI\V1\Processor>|\Google\Protobuf\Internal\RepeatedField $processors - * The list of processors. - * @type string $next_page_token - * Points to the next processor, otherwise empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The list of processors. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProcessors() - { - return $this->processors; - } - - /** - * The list of processors. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.Processor processors = 1; - * @param array<\Google\Cloud\DocumentAI\V1\Processor>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProcessors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Processor::class); - $this->processors = $arr; - - return $this; - } - - /** - * Points to the next processor, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Points to the next processor, otherwise empty. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/NormalizedVertex.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/NormalizedVertex.php deleted file mode 100644 index a283c6a9b7c2..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/NormalizedVertex.php +++ /dev/null @@ -1,103 +0,0 @@ -google.cloud.documentai.v1.NormalizedVertex - */ -class NormalizedVertex extends \Google\Protobuf\Internal\Message -{ - /** - * X coordinate. - * - * Generated from protobuf field float x = 1; - */ - protected $x = 0.0; - /** - * Y coordinate (starts from the top of the image). - * - * Generated from protobuf field float y = 2; - */ - protected $y = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $x - * X coordinate. - * @type float $y - * Y coordinate (starts from the top of the image). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Geometry::initOnce(); - parent::__construct($data); - } - - /** - * X coordinate. - * - * Generated from protobuf field float x = 1; - * @return float - */ - public function getX() - { - return $this->x; - } - - /** - * X coordinate. - * - * Generated from protobuf field float x = 1; - * @param float $var - * @return $this - */ - public function setX($var) - { - GPBUtil::checkFloat($var); - $this->x = $var; - - return $this; - } - - /** - * Y coordinate (starts from the top of the image). - * - * Generated from protobuf field float y = 2; - * @return float - */ - public function getY() - { - return $this->y; - } - - /** - * Y coordinate (starts from the top of the image). - * - * Generated from protobuf field float y = 2; - * @param float $var - * @return $this - */ - public function setY($var) - { - GPBUtil::checkFloat($var); - $this->y = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig.php deleted file mode 100644 index fe85b30cb232..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig.php +++ /dev/null @@ -1,378 +0,0 @@ -google.cloud.documentai.v1.OcrConfig - */ -class OcrConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Hints for the OCR model. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.Hints hints = 2; - */ - protected $hints = null; - /** - * Enables special handling for PDFs with existing text information. Results - * in better text extraction quality in such PDF inputs. - * - * Generated from protobuf field bool enable_native_pdf_parsing = 3; - */ - protected $enable_native_pdf_parsing = false; - /** - * Enables intelligent document quality scores after OCR. Can help with - * diagnosing why OCR responses are of poor quality for a given input. - * Adds additional latency comparable to regular OCR to the process call. - * - * Generated from protobuf field bool enable_image_quality_scores = 4; - */ - protected $enable_image_quality_scores = false; - /** - * A list of advanced OCR options to further fine-tune OCR behavior. Current - * valid values are: - * - `legacy_layout`: a heuristics layout detection algorithm, which serves as - * an alternative to the current ML-based layout detection algorithm. - * Customers can choose the best suitable layout algorithm based on their - * situation. - * - * Generated from protobuf field repeated string advanced_ocr_options = 5; - */ - private $advanced_ocr_options; - /** - * Includes symbol level OCR information if set to true. - * - * Generated from protobuf field bool enable_symbol = 6; - */ - protected $enable_symbol = false; - /** - * Turn on font identification model and return font style information. - * Deprecated, use - * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] - * instead. - * - * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; - * @deprecated - */ - protected $compute_style_info = false; - /** - * Turn off character box detector in OCR engine. Character box detection is - * enabled by default in OCR 2.0 (and later) processors. - * - * Generated from protobuf field bool disable_character_boxes_detection = 10; - */ - protected $disable_character_boxes_detection = false; - /** - * Configurations for premium OCR features. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; - */ - protected $premium_features = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\OcrConfig\Hints $hints - * Hints for the OCR model. - * @type bool $enable_native_pdf_parsing - * Enables special handling for PDFs with existing text information. Results - * in better text extraction quality in such PDF inputs. - * @type bool $enable_image_quality_scores - * Enables intelligent document quality scores after OCR. Can help with - * diagnosing why OCR responses are of poor quality for a given input. - * Adds additional latency comparable to regular OCR to the process call. - * @type array|\Google\Protobuf\Internal\RepeatedField $advanced_ocr_options - * A list of advanced OCR options to further fine-tune OCR behavior. Current - * valid values are: - * - `legacy_layout`: a heuristics layout detection algorithm, which serves as - * an alternative to the current ML-based layout detection algorithm. - * Customers can choose the best suitable layout algorithm based on their - * situation. - * @type bool $enable_symbol - * Includes symbol level OCR information if set to true. - * @type bool $compute_style_info - * Turn on font identification model and return font style information. - * Deprecated, use - * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] - * instead. - * @type bool $disable_character_boxes_detection - * Turn off character box detector in OCR engine. Character box detection is - * enabled by default in OCR 2.0 (and later) processors. - * @type \Google\Cloud\DocumentAI\V1\OcrConfig\PremiumFeatures $premium_features - * Configurations for premium OCR features. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * Hints for the OCR model. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.Hints hints = 2; - * @return \Google\Cloud\DocumentAI\V1\OcrConfig\Hints|null - */ - public function getHints() - { - return $this->hints; - } - - public function hasHints() - { - return isset($this->hints); - } - - public function clearHints() - { - unset($this->hints); - } - - /** - * Hints for the OCR model. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.Hints hints = 2; - * @param \Google\Cloud\DocumentAI\V1\OcrConfig\Hints $var - * @return $this - */ - public function setHints($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\OcrConfig\Hints::class); - $this->hints = $var; - - return $this; - } - - /** - * Enables special handling for PDFs with existing text information. Results - * in better text extraction quality in such PDF inputs. - * - * Generated from protobuf field bool enable_native_pdf_parsing = 3; - * @return bool - */ - public function getEnableNativePdfParsing() - { - return $this->enable_native_pdf_parsing; - } - - /** - * Enables special handling for PDFs with existing text information. Results - * in better text extraction quality in such PDF inputs. - * - * Generated from protobuf field bool enable_native_pdf_parsing = 3; - * @param bool $var - * @return $this - */ - public function setEnableNativePdfParsing($var) - { - GPBUtil::checkBool($var); - $this->enable_native_pdf_parsing = $var; - - return $this; - } - - /** - * Enables intelligent document quality scores after OCR. Can help with - * diagnosing why OCR responses are of poor quality for a given input. - * Adds additional latency comparable to regular OCR to the process call. - * - * Generated from protobuf field bool enable_image_quality_scores = 4; - * @return bool - */ - public function getEnableImageQualityScores() - { - return $this->enable_image_quality_scores; - } - - /** - * Enables intelligent document quality scores after OCR. Can help with - * diagnosing why OCR responses are of poor quality for a given input. - * Adds additional latency comparable to regular OCR to the process call. - * - * Generated from protobuf field bool enable_image_quality_scores = 4; - * @param bool $var - * @return $this - */ - public function setEnableImageQualityScores($var) - { - GPBUtil::checkBool($var); - $this->enable_image_quality_scores = $var; - - return $this; - } - - /** - * A list of advanced OCR options to further fine-tune OCR behavior. Current - * valid values are: - * - `legacy_layout`: a heuristics layout detection algorithm, which serves as - * an alternative to the current ML-based layout detection algorithm. - * Customers can choose the best suitable layout algorithm based on their - * situation. - * - * Generated from protobuf field repeated string advanced_ocr_options = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAdvancedOcrOptions() - { - return $this->advanced_ocr_options; - } - - /** - * A list of advanced OCR options to further fine-tune OCR behavior. Current - * valid values are: - * - `legacy_layout`: a heuristics layout detection algorithm, which serves as - * an alternative to the current ML-based layout detection algorithm. - * Customers can choose the best suitable layout algorithm based on their - * situation. - * - * Generated from protobuf field repeated string advanced_ocr_options = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAdvancedOcrOptions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->advanced_ocr_options = $arr; - - return $this; - } - - /** - * Includes symbol level OCR information if set to true. - * - * Generated from protobuf field bool enable_symbol = 6; - * @return bool - */ - public function getEnableSymbol() - { - return $this->enable_symbol; - } - - /** - * Includes symbol level OCR information if set to true. - * - * Generated from protobuf field bool enable_symbol = 6; - * @param bool $var - * @return $this - */ - public function setEnableSymbol($var) - { - GPBUtil::checkBool($var); - $this->enable_symbol = $var; - - return $this; - } - - /** - * Turn on font identification model and return font style information. - * Deprecated, use - * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] - * instead. - * - * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; - * @return bool - * @deprecated - */ - public function getComputeStyleInfo() - { - @trigger_error('compute_style_info is deprecated.', E_USER_DEPRECATED); - return $this->compute_style_info; - } - - /** - * Turn on font identification model and return font style information. - * Deprecated, use - * [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info] - * instead. - * - * Generated from protobuf field bool compute_style_info = 8 [deprecated = true]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setComputeStyleInfo($var) - { - @trigger_error('compute_style_info is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->compute_style_info = $var; - - return $this; - } - - /** - * Turn off character box detector in OCR engine. Character box detection is - * enabled by default in OCR 2.0 (and later) processors. - * - * Generated from protobuf field bool disable_character_boxes_detection = 10; - * @return bool - */ - public function getDisableCharacterBoxesDetection() - { - return $this->disable_character_boxes_detection; - } - - /** - * Turn off character box detector in OCR engine. Character box detection is - * enabled by default in OCR 2.0 (and later) processors. - * - * Generated from protobuf field bool disable_character_boxes_detection = 10; - * @param bool $var - * @return $this - */ - public function setDisableCharacterBoxesDetection($var) - { - GPBUtil::checkBool($var); - $this->disable_character_boxes_detection = $var; - - return $this; - } - - /** - * Configurations for premium OCR features. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; - * @return \Google\Cloud\DocumentAI\V1\OcrConfig\PremiumFeatures|null - */ - public function getPremiumFeatures() - { - return $this->premium_features; - } - - public function hasPremiumFeatures() - { - return isset($this->premium_features); - } - - public function clearPremiumFeatures() - { - unset($this->premium_features); - } - - /** - * Configurations for premium OCR features. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11; - * @param \Google\Cloud\DocumentAI\V1\OcrConfig\PremiumFeatures $var - * @return $this - */ - public function setPremiumFeatures($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\OcrConfig\PremiumFeatures::class); - $this->premium_features = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/Hints.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/Hints.php deleted file mode 100644 index 1e0be646e760..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/Hints.php +++ /dev/null @@ -1,90 +0,0 @@ -google.cloud.documentai.v1.OcrConfig.Hints - */ -class Hints extends \Google\Protobuf\Internal\Message -{ - /** - * List of BCP-47 language codes to use for OCR. In most cases, not - * specifying it yields the best results since it enables automatic language - * detection. For languages based on the Latin alphabet, setting hints is - * not needed. In rare cases, when the language of the text in the - * image is known, setting a hint will help get better results (although it - * will be a significant hindrance if the hint is wrong). - * - * Generated from protobuf field repeated string language_hints = 1; - */ - private $language_hints; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $language_hints - * List of BCP-47 language codes to use for OCR. In most cases, not - * specifying it yields the best results since it enables automatic language - * detection. For languages based on the Latin alphabet, setting hints is - * not needed. In rare cases, when the language of the text in the - * image is known, setting a hint will help get better results (although it - * will be a significant hindrance if the hint is wrong). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * List of BCP-47 language codes to use for OCR. In most cases, not - * specifying it yields the best results since it enables automatic language - * detection. For languages based on the Latin alphabet, setting hints is - * not needed. In rare cases, when the language of the text in the - * image is known, setting a hint will help get better results (although it - * will be a significant hindrance if the hint is wrong). - * - * Generated from protobuf field repeated string language_hints = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLanguageHints() - { - return $this->language_hints; - } - - /** - * List of BCP-47 language codes to use for OCR. In most cases, not - * specifying it yields the best results since it enables automatic language - * detection. For languages based on the Latin alphabet, setting hints is - * not needed. In rare cases, when the language of the text in the - * image is known, setting a hint will help get better results (although it - * will be a significant hindrance if the hint is wrong). - * - * Generated from protobuf field repeated string language_hints = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLanguageHints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->language_hints = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Hints::class, \Google\Cloud\DocumentAI\V1\OcrConfig_Hints::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/PremiumFeatures.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/PremiumFeatures.php deleted file mode 100644 index 7de94440773c..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/OcrConfig/PremiumFeatures.php +++ /dev/null @@ -1,142 +0,0 @@ -google.cloud.documentai.v1.OcrConfig.PremiumFeatures - */ -class PremiumFeatures extends \Google\Protobuf\Internal\Message -{ - /** - * Turn on selection mark detector in OCR engine. Only available in OCR 2.0 - * (and later) processors. - * - * Generated from protobuf field bool enable_selection_mark_detection = 3; - */ - protected $enable_selection_mark_detection = false; - /** - * Turn on font identification model and return font style information. - * - * Generated from protobuf field bool compute_style_info = 4; - */ - protected $compute_style_info = false; - /** - * Turn on the model that can extract LaTeX math formulas. - * - * Generated from protobuf field bool enable_math_ocr = 5; - */ - protected $enable_math_ocr = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $enable_selection_mark_detection - * Turn on selection mark detector in OCR engine. Only available in OCR 2.0 - * (and later) processors. - * @type bool $compute_style_info - * Turn on font identification model and return font style information. - * @type bool $enable_math_ocr - * Turn on the model that can extract LaTeX math formulas. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * Turn on selection mark detector in OCR engine. Only available in OCR 2.0 - * (and later) processors. - * - * Generated from protobuf field bool enable_selection_mark_detection = 3; - * @return bool - */ - public function getEnableSelectionMarkDetection() - { - return $this->enable_selection_mark_detection; - } - - /** - * Turn on selection mark detector in OCR engine. Only available in OCR 2.0 - * (and later) processors. - * - * Generated from protobuf field bool enable_selection_mark_detection = 3; - * @param bool $var - * @return $this - */ - public function setEnableSelectionMarkDetection($var) - { - GPBUtil::checkBool($var); - $this->enable_selection_mark_detection = $var; - - return $this; - } - - /** - * Turn on font identification model and return font style information. - * - * Generated from protobuf field bool compute_style_info = 4; - * @return bool - */ - public function getComputeStyleInfo() - { - return $this->compute_style_info; - } - - /** - * Turn on font identification model and return font style information. - * - * Generated from protobuf field bool compute_style_info = 4; - * @param bool $var - * @return $this - */ - public function setComputeStyleInfo($var) - { - GPBUtil::checkBool($var); - $this->compute_style_info = $var; - - return $this; - } - - /** - * Turn on the model that can extract LaTeX math formulas. - * - * Generated from protobuf field bool enable_math_ocr = 5; - * @return bool - */ - public function getEnableMathOcr() - { - return $this->enable_math_ocr; - } - - /** - * Turn on the model that can extract LaTeX math formulas. - * - * Generated from protobuf field bool enable_math_ocr = 5; - * @param bool $var - * @return $this - */ - public function setEnableMathOcr($var) - { - GPBUtil::checkBool($var); - $this->enable_math_ocr = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PremiumFeatures::class, \Google\Cloud\DocumentAI\V1\OcrConfig_PremiumFeatures::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions.php deleted file mode 100644 index 57efd2bf2b73..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions.php +++ /dev/null @@ -1,300 +0,0 @@ -google.cloud.documentai.v1.ProcessOptions - */ -class ProcessOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. - * Returns error if set on other processor types. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig ocr_config = 1; - */ - protected $ocr_config = null; - /** - * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. - * Returns error if set on other processor types. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $layout_config = null; - /** - * Optional. Override the schema of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will - * return an Invalid Argument error if this field is set when the underlying - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't - * support schema override. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $schema_override = null; - protected $page_range; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\ProcessOptions\IndividualPageSelector $individual_page_selector - * Which pages to process (1-indexed). - * @type int $from_start - * Only process certain pages from the start. Process all if the document - * has fewer pages. - * @type int $from_end - * Only process certain pages from the end, same as above. - * @type \Google\Cloud\DocumentAI\V1\OcrConfig $ocr_config - * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. - * Returns error if set on other processor types. - * @type \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig $layout_config - * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. - * Returns error if set on other processor types. - * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $schema_override - * Optional. Override the schema of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will - * return an Invalid Argument error if this field is set when the underlying - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't - * support schema override. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Which pages to process (1-indexed). - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector individual_page_selector = 5; - * @return \Google\Cloud\DocumentAI\V1\ProcessOptions\IndividualPageSelector|null - */ - public function getIndividualPageSelector() - { - return $this->readOneof(5); - } - - public function hasIndividualPageSelector() - { - return $this->hasOneof(5); - } - - /** - * Which pages to process (1-indexed). - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector individual_page_selector = 5; - * @param \Google\Cloud\DocumentAI\V1\ProcessOptions\IndividualPageSelector $var - * @return $this - */ - public function setIndividualPageSelector($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions\IndividualPageSelector::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Only process certain pages from the start. Process all if the document - * has fewer pages. - * - * Generated from protobuf field int32 from_start = 6; - * @return int - */ - public function getFromStart() - { - return $this->readOneof(6); - } - - public function hasFromStart() - { - return $this->hasOneof(6); - } - - /** - * Only process certain pages from the start. Process all if the document - * has fewer pages. - * - * Generated from protobuf field int32 from_start = 6; - * @param int $var - * @return $this - */ - public function setFromStart($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Only process certain pages from the end, same as above. - * - * Generated from protobuf field int32 from_end = 7; - * @return int - */ - public function getFromEnd() - { - return $this->readOneof(7); - } - - public function hasFromEnd() - { - return $this->hasOneof(7); - } - - /** - * Only process certain pages from the end, same as above. - * - * Generated from protobuf field int32 from_end = 7; - * @param int $var - * @return $this - */ - public function setFromEnd($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. - * Returns error if set on other processor types. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig ocr_config = 1; - * @return \Google\Cloud\DocumentAI\V1\OcrConfig|null - */ - public function getOcrConfig() - { - return $this->ocr_config; - } - - public function hasOcrConfig() - { - return isset($this->ocr_config); - } - - public function clearOcrConfig() - { - unset($this->ocr_config); - } - - /** - * Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`. - * Returns error if set on other processor types. - * - * Generated from protobuf field .google.cloud.documentai.v1.OcrConfig ocr_config = 1; - * @param \Google\Cloud\DocumentAI\V1\OcrConfig $var - * @return $this - */ - public function setOcrConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\OcrConfig::class); - $this->ocr_config = $var; - - return $this; - } - - /** - * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. - * Returns error if set on other processor types. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig|null - */ - public function getLayoutConfig() - { - return $this->layout_config; - } - - public function hasLayoutConfig() - { - return isset($this->layout_config); - } - - public function clearLayoutConfig() - { - unset($this->layout_config); - } - - /** - * Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`. - * Returns error if set on other processor types. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig layout_config = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig $var - * @return $this - */ - public function setLayoutConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig::class); - $this->layout_config = $var; - - return $this; - } - - /** - * Optional. Override the schema of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will - * return an Invalid Argument error if this field is set when the underlying - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't - * support schema override. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null - */ - public function getSchemaOverride() - { - return $this->schema_override; - } - - public function hasSchemaOverride() - { - return isset($this->schema_override); - } - - public function clearSchemaOverride() - { - unset($this->schema_override); - } - - /** - * Optional. Override the schema of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will - * return an Invalid Argument error if this field is set when the underlying - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't - * support schema override. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema schema_override = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var - * @return $this - */ - public function setSchemaOverride($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema::class); - $this->schema_override = $var; - - return $this; - } - - /** - * @return string - */ - public function getPageRange() - { - return $this->whichOneof("page_range"); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/IndividualPageSelector.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/IndividualPageSelector.php deleted file mode 100644 index 40cdb2cac3df..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/IndividualPageSelector.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - */ -class IndividualPageSelector extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Indices of the pages (starting from 1). - * - * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $pages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $pages - * Optional. Indices of the pages (starting from 1). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Indices of the pages (starting from 1). - * - * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPages() - { - return $this->pages; - } - - /** - * Optional. Indices of the pages (starting from 1). - * - * Generated from protobuf field repeated int32 pages = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->pages = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IndividualPageSelector::class, \Google\Cloud\DocumentAI\V1\ProcessOptions_IndividualPageSelector::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig.php deleted file mode 100644 index 7b809cd9b86c..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig.php +++ /dev/null @@ -1,80 +0,0 @@ -google.cloud.documentai.v1.ProcessOptions.LayoutConfig - */ -class LayoutConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Config for chunking in layout parser processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $chunking_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig $chunking_config - * Optional. Config for chunking in layout parser processor. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Config for chunking in layout parser processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig|null - */ - public function getChunkingConfig() - { - return $this->chunking_config; - } - - public function hasChunkingConfig() - { - return isset($this->chunking_config); - } - - public function clearChunkingConfig() - { - unset($this->chunking_config); - } - - /** - * Optional. Config for chunking in layout parser processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig chunking_config = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig $var - * @return $this - */ - public function setChunkingConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions\LayoutConfig\ChunkingConfig::class); - $this->chunking_config = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LayoutConfig::class, \Google\Cloud\DocumentAI\V1\ProcessOptions_LayoutConfig::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php deleted file mode 100644 index eb6139b1159d..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessOptions/LayoutConfig/ChunkingConfig.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - */ -class ChunkingConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The chunk sizes to use when splitting documents, in order of - * level. - * - * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $chunk_size = 0; - /** - * Optional. Whether or not to include ancestor headings when splitting. - * - * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $include_ancestor_headings = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $chunk_size - * Optional. The chunk sizes to use when splitting documents, in order of - * level. - * @type bool $include_ancestor_headings - * Optional. Whether or not to include ancestor headings when splitting. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The chunk sizes to use when splitting documents, in order of - * level. - * - * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getChunkSize() - { - return $this->chunk_size; - } - - /** - * Optional. The chunk sizes to use when splitting documents, in order of - * level. - * - * Generated from protobuf field int32 chunk_size = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setChunkSize($var) - { - GPBUtil::checkInt32($var); - $this->chunk_size = $var; - - return $this; - } - - /** - * Optional. Whether or not to include ancestor headings when splitting. - * - * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getIncludeAncestorHeadings() - { - return $this->include_ancestor_headings; - } - - /** - * Optional. Whether or not to include ancestor headings when splitting. - * - * Generated from protobuf field bool include_ancestor_headings = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setIncludeAncestorHeadings($var) - { - GPBUtil::checkBool($var); - $this->include_ancestor_headings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ChunkingConfig::class, \Google\Cloud\DocumentAI\V1\ProcessOptions_LayoutConfig_ChunkingConfig::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessRequest.php deleted file mode 100644 index fa157c5cd440..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessRequest.php +++ /dev/null @@ -1,457 +0,0 @@ -google.cloud.documentai.v1.ProcessRequest - */ -class ProcessRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a - * [Processor][google.cloud.documentai.v1.Processor] is specified, the server - * will use its [default - * version][google.cloud.documentai.v1.Processor.default_processor_version]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Whether human review should be skipped for this request. Default to - * `false`. - * - * Generated from protobuf field bool skip_human_review = 3; - */ - protected $skip_human_review = false; - /** - * Specifies which fields to include in the - * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] - * output. Only supports top-level document and pages field, so it must be in - * the form of `{document_field_name}` or `pages.{page_field_name}`. - * - * Generated from protobuf field .google.protobuf.FieldMask field_mask = 6; - */ - protected $field_mask = null; - /** - * Inference-time options for the process API - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; - */ - protected $process_options = null; - /** - * Optional. The labels with user-defined metadata for the request. - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. Option to remove images from the document. - * - * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $imageless_mode = false; - protected $source; - - /** - * @param string $name Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a - * [Processor][google.cloud.documentai.v1.Processor] is specified, the server - * will use its [default - * version][google.cloud.documentai.v1.Processor.default_processor_version]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * @return \Google\Cloud\DocumentAI\V1\ProcessRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document $inline_document - * An inline document proto. - * @type \Google\Cloud\DocumentAI\V1\RawDocument $raw_document - * A raw document content (bytes). - * @type \Google\Cloud\DocumentAI\V1\GcsDocument $gcs_document - * A raw document on Google Cloud Storage. - * @type string $name - * Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a - * [Processor][google.cloud.documentai.v1.Processor] is specified, the server - * will use its [default - * version][google.cloud.documentai.v1.Processor.default_processor_version]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @type bool $skip_human_review - * Whether human review should be skipped for this request. Default to - * `false`. - * @type \Google\Protobuf\FieldMask $field_mask - * Specifies which fields to include in the - * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] - * output. Only supports top-level document and pages field, so it must be in - * the form of `{document_field_name}` or `pages.{page_field_name}`. - * @type \Google\Cloud\DocumentAI\V1\ProcessOptions $process_options - * Inference-time options for the process API - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. The labels with user-defined metadata for the request. - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * @type bool $imageless_mode - * Optional. Option to remove images from the document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * An inline document proto. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document inline_document = 4; - * @return \Google\Cloud\DocumentAI\V1\Document|null - */ - public function getInlineDocument() - { - return $this->readOneof(4); - } - - public function hasInlineDocument() - { - return $this->hasOneof(4); - } - - /** - * An inline document proto. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document inline_document = 4; - * @param \Google\Cloud\DocumentAI\V1\Document $var - * @return $this - */ - public function setInlineDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * A raw document content (bytes). - * - * Generated from protobuf field .google.cloud.documentai.v1.RawDocument raw_document = 5; - * @return \Google\Cloud\DocumentAI\V1\RawDocument|null - */ - public function getRawDocument() - { - return $this->readOneof(5); - } - - public function hasRawDocument() - { - return $this->hasOneof(5); - } - - /** - * A raw document content (bytes). - * - * Generated from protobuf field .google.cloud.documentai.v1.RawDocument raw_document = 5; - * @param \Google\Cloud\DocumentAI\V1\RawDocument $var - * @return $this - */ - public function setRawDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\RawDocument::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * A raw document on Google Cloud Storage. - * - * Generated from protobuf field .google.cloud.documentai.v1.GcsDocument gcs_document = 8; - * @return \Google\Cloud\DocumentAI\V1\GcsDocument|null - */ - public function getGcsDocument() - { - return $this->readOneof(8); - } - - public function hasGcsDocument() - { - return $this->hasOneof(8); - } - - /** - * A raw document on Google Cloud Storage. - * - * Generated from protobuf field .google.cloud.documentai.v1.GcsDocument gcs_document = 8; - * @param \Google\Cloud\DocumentAI\V1\GcsDocument $var - * @return $this - */ - public function setGcsDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\GcsDocument::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a - * [Processor][google.cloud.documentai.v1.Processor] is specified, the server - * will use its [default - * version][google.cloud.documentai.v1.Processor.default_processor_version]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a - * [Processor][google.cloud.documentai.v1.Processor] is specified, the server - * will use its [default - * version][google.cloud.documentai.v1.Processor.default_processor_version]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Whether human review should be skipped for this request. Default to - * `false`. - * - * Generated from protobuf field bool skip_human_review = 3; - * @return bool - */ - public function getSkipHumanReview() - { - return $this->skip_human_review; - } - - /** - * Whether human review should be skipped for this request. Default to - * `false`. - * - * Generated from protobuf field bool skip_human_review = 3; - * @param bool $var - * @return $this - */ - public function setSkipHumanReview($var) - { - GPBUtil::checkBool($var); - $this->skip_human_review = $var; - - return $this; - } - - /** - * Specifies which fields to include in the - * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] - * output. Only supports top-level document and pages field, so it must be in - * the form of `{document_field_name}` or `pages.{page_field_name}`. - * - * Generated from protobuf field .google.protobuf.FieldMask field_mask = 6; - * @return \Google\Protobuf\FieldMask|null - */ - public function getFieldMask() - { - return $this->field_mask; - } - - public function hasFieldMask() - { - return isset($this->field_mask); - } - - public function clearFieldMask() - { - unset($this->field_mask); - } - - /** - * Specifies which fields to include in the - * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] - * output. Only supports top-level document and pages field, so it must be in - * the form of `{document_field_name}` or `pages.{page_field_name}`. - * - * Generated from protobuf field .google.protobuf.FieldMask field_mask = 6; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setFieldMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->field_mask = $var; - - return $this; - } - - /** - * Inference-time options for the process API - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; - * @return \Google\Cloud\DocumentAI\V1\ProcessOptions|null - */ - public function getProcessOptions() - { - return $this->process_options; - } - - public function hasProcessOptions() - { - return isset($this->process_options); - } - - public function clearProcessOptions() - { - unset($this->process_options); - } - - /** - * Inference-time options for the process API - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessOptions process_options = 7; - * @param \Google\Cloud\DocumentAI\V1\ProcessOptions $var - * @return $this - */ - public function setProcessOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessOptions::class); - $this->process_options = $var; - - return $this; - } - - /** - * Optional. The labels with user-defined metadata for the request. - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. The labels with user-defined metadata for the request. - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Optional. Option to remove images from the document. - * - * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getImagelessMode() - { - return $this->imageless_mode; - } - - /** - * Optional. Option to remove images from the document. - * - * Generated from protobuf field bool imageless_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setImagelessMode($var) - { - GPBUtil::checkBool($var); - $this->imageless_mode = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessResponse.php deleted file mode 100644 index cb8f9c7b8c36..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessResponse.php +++ /dev/null @@ -1,127 +0,0 @@ -google.cloud.documentai.v1.ProcessResponse - */ -class ProcessResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The document payload, will populate fields based on the processor's - * behavior. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document document = 1; - */ - protected $document = null; - /** - * The status of human review on the processed document. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 3; - */ - protected $human_review_status = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document $document - * The document payload, will populate fields based on the processor's - * behavior. - * @type \Google\Cloud\DocumentAI\V1\HumanReviewStatus $human_review_status - * The status of human review on the processed document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The document payload, will populate fields based on the processor's - * behavior. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document document = 1; - * @return \Google\Cloud\DocumentAI\V1\Document|null - */ - public function getDocument() - { - return $this->document; - } - - public function hasDocument() - { - return isset($this->document); - } - - public function clearDocument() - { - unset($this->document); - } - - /** - * The document payload, will populate fields based on the processor's - * behavior. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document document = 1; - * @param \Google\Cloud\DocumentAI\V1\Document $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document::class); - $this->document = $var; - - return $this; - } - - /** - * The status of human review on the processed document. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 3; - * @return \Google\Cloud\DocumentAI\V1\HumanReviewStatus|null - */ - public function getHumanReviewStatus() - { - return $this->human_review_status; - } - - public function hasHumanReviewStatus() - { - return isset($this->human_review_status); - } - - public function clearHumanReviewStatus() - { - unset($this->human_review_status); - } - - /** - * The status of human review on the processed document. - * - * Generated from protobuf field .google.cloud.documentai.v1.HumanReviewStatus human_review_status = 3; - * @param \Google\Cloud\DocumentAI\V1\HumanReviewStatus $var - * @return $this - */ - public function setHumanReviewStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\HumanReviewStatus::class); - $this->human_review_status = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor.php deleted file mode 100644 index 4835b189de65..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor.php +++ /dev/null @@ -1,438 +0,0 @@ -google.cloud.documentai.v1.Processor - */ -class Processor extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Immutable. The resource name of the processor. - * Format: `projects/{project}/locations/{location}/processors/{processor}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - * To get a list of processor types, see - * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. - * - * Generated from protobuf field string type = 2; - */ - protected $type = ''; - /** - * The display name of the processor. - * - * Generated from protobuf field string display_name = 3; - */ - protected $display_name = ''; - /** - * Output only. The state of the processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * The default processor version. - * - * Generated from protobuf field string default_processor_version = 9 [(.google.api.resource_reference) = { - */ - protected $default_processor_version = ''; - /** - * Output only. The processor version aliases. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersionAlias processor_version_aliases = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $processor_version_aliases; - /** - * Output only. Immutable. The http endpoint that can be called to invoke - * processing. - * - * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $process_endpoint = ''; - /** - * The time the processor was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - */ - protected $create_time = null; - /** - * The [KMS key](https://cloud.google.com/security-key-management) used for - * encryption and decryption in CMEK scenarios. - * - * Generated from protobuf field string kms_key_name = 8; - */ - protected $kms_key_name = ''; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = false; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzi = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Immutable. The resource name of the processor. - * Format: `projects/{project}/locations/{location}/processors/{processor}` - * @type string $type - * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - * To get a list of processor types, see - * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. - * @type string $display_name - * The display name of the processor. - * @type int $state - * Output only. The state of the processor. - * @type string $default_processor_version - * The default processor version. - * @type array<\Google\Cloud\DocumentAI\V1\ProcessorVersionAlias>|\Google\Protobuf\Internal\RepeatedField $processor_version_aliases - * Output only. The processor version aliases. - * @type string $process_endpoint - * Output only. Immutable. The http endpoint that can be called to invoke - * processing. - * @type \Google\Protobuf\Timestamp $create_time - * The time the processor was created. - * @type string $kms_key_name - * The [KMS key](https://cloud.google.com/security-key-management) used for - * encryption and decryption in CMEK scenarios. - * @type bool $satisfies_pzs - * Output only. Reserved for future use. - * @type bool $satisfies_pzi - * Output only. Reserved for future use. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Immutable. The resource name of the processor. - * Format: `projects/{project}/locations/{location}/processors/{processor}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Immutable. The resource name of the processor. - * Format: `projects/{project}/locations/{location}/processors/{processor}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - * To get a list of processor types, see - * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. - * - * Generated from protobuf field string type = 2; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - * To get a list of processor types, see - * [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. - * - * Generated from protobuf field string type = 2; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * The display name of the processor. - * - * Generated from protobuf field string display_name = 3; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the processor. - * - * Generated from protobuf field string display_name = 3; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The state of the processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of the processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.Processor.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\Processor\State::class); - $this->state = $var; - - return $this; - } - - /** - * The default processor version. - * - * Generated from protobuf field string default_processor_version = 9 [(.google.api.resource_reference) = { - * @return string - */ - public function getDefaultProcessorVersion() - { - return $this->default_processor_version; - } - - /** - * The default processor version. - * - * Generated from protobuf field string default_processor_version = 9 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDefaultProcessorVersion($var) - { - GPBUtil::checkString($var, True); - $this->default_processor_version = $var; - - return $this; - } - - /** - * Output only. The processor version aliases. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersionAlias processor_version_aliases = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProcessorVersionAliases() - { - return $this->processor_version_aliases; - } - - /** - * Output only. The processor version aliases. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorVersionAlias processor_version_aliases = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\DocumentAI\V1\ProcessorVersionAlias>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProcessorVersionAliases($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorVersionAlias::class); - $this->processor_version_aliases = $arr; - - return $this; - } - - /** - * Output only. Immutable. The http endpoint that can be called to invoke - * processing. - * - * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getProcessEndpoint() - { - return $this->process_endpoint; - } - - /** - * Output only. Immutable. The http endpoint that can be called to invoke - * processing. - * - * Generated from protobuf field string process_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setProcessEndpoint($var) - { - GPBUtil::checkString($var, True); - $this->process_endpoint = $var; - - return $this; - } - - /** - * The time the processor was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time the processor was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The [KMS key](https://cloud.google.com/security-key-management) used for - * encryption and decryption in CMEK scenarios. - * - * Generated from protobuf field string kms_key_name = 8; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The [KMS key](https://cloud.google.com/security-key-management) used for - * encryption and decryption in CMEK scenarios. - * - * Generated from protobuf field string kms_key_name = 8; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzi() - { - return $this->satisfies_pzi; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzi($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzi = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor/State.php deleted file mode 100644 index 4b15938e4a46..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Processor/State.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.documentai.v1.Processor.State - */ -class State -{ - /** - * The processor is in an unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The processor is enabled, i.e., has an enabled version which can - * currently serve processing requests and all the feature dependencies have - * been successfully initialized. - * - * Generated from protobuf enum ENABLED = 1; - */ - const ENABLED = 1; - /** - * The processor is disabled. - * - * Generated from protobuf enum DISABLED = 2; - */ - const DISABLED = 2; - /** - * The processor is being enabled, will become `ENABLED` if successful. - * - * Generated from protobuf enum ENABLING = 3; - */ - const ENABLING = 3; - /** - * The processor is being disabled, will become `DISABLED` if successful. - * - * Generated from protobuf enum DISABLING = 4; - */ - const DISABLING = 4; - /** - * The processor is being created, will become either `ENABLED` (for - * successful creation) or `FAILED` (for failed ones). - * Once a processor is in this state, it can then be used for document - * processing, but the feature dependencies of the processor might not be - * fully created yet. - * - * Generated from protobuf enum CREATING = 5; - */ - const CREATING = 5; - /** - * The processor failed during creation or initialization of feature - * dependencies. The user should delete the processor and recreate one as - * all the functionalities of the processor are disabled. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * The processor is being deleted, will be removed if successful. - * - * Generated from protobuf enum DELETING = 7; - */ - const DELETING = 7; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ENABLED => 'ENABLED', - self::DISABLED => 'DISABLED', - self::ENABLING => 'ENABLING', - self::DISABLING => 'DISABLING', - self::CREATING => 'CREATING', - self::FAILED => 'FAILED', - self::DELETING => 'DELETING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\DocumentAI\V1\Processor_State::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType.php deleted file mode 100644 index 2ee18d7a9f8a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType.php +++ /dev/null @@ -1,280 +0,0 @@ -google.cloud.documentai.v1.ProcessorType - */ -class ProcessorType extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the processor type. - * Format: `projects/{project}/processorTypes/{processor_type}` - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - * - * Generated from protobuf field string type = 2; - */ - protected $type = ''; - /** - * The processor category, used by UI to group processor types. - * - * Generated from protobuf field string category = 3; - */ - protected $category = ''; - /** - * The locations in which this processor is available. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; - */ - private $available_locations; - /** - * Whether the processor type allows creation. If true, users can create a - * processor of this processor type. Otherwise, users need to request access. - * - * Generated from protobuf field bool allow_creation = 6; - */ - protected $allow_creation = false; - /** - * Launch stage of the processor type - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 8; - */ - protected $launch_stage = 0; - /** - * A set of Cloud Storage URIs of sample documents for this processor. - * - * Generated from protobuf field repeated string sample_document_uris = 9; - */ - private $sample_document_uris; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the processor type. - * Format: `projects/{project}/processorTypes/{processor_type}` - * @type string $type - * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - * @type string $category - * The processor category, used by UI to group processor types. - * @type array<\Google\Cloud\DocumentAI\V1\ProcessorType\LocationInfo>|\Google\Protobuf\Internal\RepeatedField $available_locations - * The locations in which this processor is available. - * @type bool $allow_creation - * Whether the processor type allows creation. If true, users can create a - * processor of this processor type. Otherwise, users need to request access. - * @type int $launch_stage - * Launch stage of the processor type - * @type array|\Google\Protobuf\Internal\RepeatedField $sample_document_uris - * A set of Cloud Storage URIs of sample documents for this processor. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\ProcessorType::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the processor type. - * Format: `projects/{project}/processorTypes/{processor_type}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the processor type. - * Format: `projects/{project}/processorTypes/{processor_type}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - * - * Generated from protobuf field string type = 2; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. - * - * Generated from protobuf field string type = 2; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * The processor category, used by UI to group processor types. - * - * Generated from protobuf field string category = 3; - * @return string - */ - public function getCategory() - { - return $this->category; - } - - /** - * The processor category, used by UI to group processor types. - * - * Generated from protobuf field string category = 3; - * @param string $var - * @return $this - */ - public function setCategory($var) - { - GPBUtil::checkString($var, True); - $this->category = $var; - - return $this; - } - - /** - * The locations in which this processor is available. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAvailableLocations() - { - return $this->available_locations; - } - - /** - * The locations in which this processor is available. - * - * Generated from protobuf field repeated .google.cloud.documentai.v1.ProcessorType.LocationInfo available_locations = 4; - * @param array<\Google\Cloud\DocumentAI\V1\ProcessorType\LocationInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAvailableLocations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\ProcessorType\LocationInfo::class); - $this->available_locations = $arr; - - return $this; - } - - /** - * Whether the processor type allows creation. If true, users can create a - * processor of this processor type. Otherwise, users need to request access. - * - * Generated from protobuf field bool allow_creation = 6; - * @return bool - */ - public function getAllowCreation() - { - return $this->allow_creation; - } - - /** - * Whether the processor type allows creation. If true, users can create a - * processor of this processor type. Otherwise, users need to request access. - * - * Generated from protobuf field bool allow_creation = 6; - * @param bool $var - * @return $this - */ - public function setAllowCreation($var) - { - GPBUtil::checkBool($var); - $this->allow_creation = $var; - - return $this; - } - - /** - * Launch stage of the processor type - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 8; - * @return int - */ - public function getLaunchStage() - { - return $this->launch_stage; - } - - /** - * Launch stage of the processor type - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 8; - * @param int $var - * @return $this - */ - public function setLaunchStage($var) - { - GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); - $this->launch_stage = $var; - - return $this; - } - - /** - * A set of Cloud Storage URIs of sample documents for this processor. - * - * Generated from protobuf field repeated string sample_document_uris = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSampleDocumentUris() - { - return $this->sample_document_uris; - } - - /** - * A set of Cloud Storage URIs of sample documents for this processor. - * - * Generated from protobuf field repeated string sample_document_uris = 9; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSampleDocumentUris($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->sample_document_uris = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType/LocationInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType/LocationInfo.php deleted file mode 100644 index aff1d4c1493b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorType/LocationInfo.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.documentai.v1.ProcessorType.LocationInfo - */ -class LocationInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The location ID. For supported locations, refer to [regional and - * multi-regional support](/document-ai/docs/regions). - * - * Generated from protobuf field string location_id = 1; - */ - protected $location_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $location_id - * The location ID. For supported locations, refer to [regional and - * multi-regional support](/document-ai/docs/regions). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\ProcessorType::initOnce(); - parent::__construct($data); - } - - /** - * The location ID. For supported locations, refer to [regional and - * multi-regional support](/document-ai/docs/regions). - * - * Generated from protobuf field string location_id = 1; - * @return string - */ - public function getLocationId() - { - return $this->location_id; - } - - /** - * The location ID. For supported locations, refer to [regional and - * multi-regional support](/document-ai/docs/regions). - * - * Generated from protobuf field string location_id = 1; - * @param string $var - * @return $this - */ - public function setLocationId($var) - { - GPBUtil::checkString($var, True); - $this->location_id = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LocationInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorType_LocationInfo::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion.php deleted file mode 100644 index 12b86ace960e..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion.php +++ /dev/null @@ -1,574 +0,0 @@ -google.cloud.documentai.v1.ProcessorVersion - */ -class ProcessorVersion extends \Google\Protobuf\Internal\Message -{ - /** - * Identifier. The resource name of the processor version. - * Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - */ - protected $name = ''; - /** - * The display name of the processor version. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * The schema of the processor version. Describes the output. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 12; - */ - protected $document_schema = null; - /** - * Output only. The state of the processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * The time the processor version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - */ - protected $create_time = null; - /** - * The most recently invoked evaluation for the processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; - */ - protected $latest_evaluation = null; - /** - * The KMS key name used for encryption. - * - * Generated from protobuf field string kms_key_name = 9; - */ - protected $kms_key_name = ''; - /** - * The KMS key version with which data is encrypted. - * - * Generated from protobuf field string kms_key_version_name = 10; - */ - protected $kms_key_version_name = ''; - /** - * Output only. Denotes that this `ProcessorVersion` is managed by Google. - * - * Generated from protobuf field bool google_managed = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $google_managed = false; - /** - * If set, information about the eventual deprecation of this version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; - */ - protected $deprecation_info = null; - /** - * Output only. The model type of this processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.ModelType model_type = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $model_type = 0; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzs = false; - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $satisfies_pzi = false; - /** - * Output only. Information about Generative AI model-based processor - * versions. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $gen_ai_model_info = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Identifier. The resource name of the processor version. - * Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - * @type string $display_name - * The display name of the processor version. - * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $document_schema - * The schema of the processor version. Describes the output. - * @type int $state - * Output only. The state of the processor version. - * @type \Google\Protobuf\Timestamp $create_time - * The time the processor version was created. - * @type \Google\Cloud\DocumentAI\V1\EvaluationReference $latest_evaluation - * The most recently invoked evaluation for the processor version. - * @type string $kms_key_name - * The KMS key name used for encryption. - * @type string $kms_key_version_name - * The KMS key version with which data is encrypted. - * @type bool $google_managed - * Output only. Denotes that this `ProcessorVersion` is managed by Google. - * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion\DeprecationInfo $deprecation_info - * If set, information about the eventual deprecation of this version. - * @type int $model_type - * Output only. The model type of this processor version. - * @type bool $satisfies_pzs - * Output only. Reserved for future use. - * @type bool $satisfies_pzi - * Output only. Reserved for future use. - * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo $gen_ai_model_info - * Output only. Information about Generative AI model-based processor - * versions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); - parent::__construct($data); - } - - /** - * Identifier. The resource name of the processor version. - * Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Identifier. The resource name of the processor version. - * Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The display name of the processor version. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the processor version. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The schema of the processor version. Describes the output. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 12; - * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null - */ - public function getDocumentSchema() - { - return $this->document_schema; - } - - public function hasDocumentSchema() - { - return isset($this->document_schema); - } - - public function clearDocumentSchema() - { - unset($this->document_schema); - } - - /** - * The schema of the processor version. Describes the output. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 12; - * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var - * @return $this - */ - public function setDocumentSchema($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema::class); - $this->document_schema = $var; - - return $this; - } - - /** - * Output only. The state of the processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of the processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\State::class); - $this->state = $var; - - return $this; - } - - /** - * The time the processor version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time the processor version was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The most recently invoked evaluation for the processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; - * @return \Google\Cloud\DocumentAI\V1\EvaluationReference|null - */ - public function getLatestEvaluation() - { - return $this->latest_evaluation; - } - - public function hasLatestEvaluation() - { - return isset($this->latest_evaluation); - } - - public function clearLatestEvaluation() - { - unset($this->latest_evaluation); - } - - /** - * The most recently invoked evaluation for the processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.EvaluationReference latest_evaluation = 8; - * @param \Google\Cloud\DocumentAI\V1\EvaluationReference $var - * @return $this - */ - public function setLatestEvaluation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\EvaluationReference::class); - $this->latest_evaluation = $var; - - return $this; - } - - /** - * The KMS key name used for encryption. - * - * Generated from protobuf field string kms_key_name = 9; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * The KMS key name used for encryption. - * - * Generated from protobuf field string kms_key_name = 9; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * The KMS key version with which data is encrypted. - * - * Generated from protobuf field string kms_key_version_name = 10; - * @return string - */ - public function getKmsKeyVersionName() - { - return $this->kms_key_version_name; - } - - /** - * The KMS key version with which data is encrypted. - * - * Generated from protobuf field string kms_key_version_name = 10; - * @param string $var - * @return $this - */ - public function setKmsKeyVersionName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_version_name = $var; - - return $this; - } - - /** - * Output only. Denotes that this `ProcessorVersion` is managed by Google. - * - * Generated from protobuf field bool google_managed = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getGoogleManaged() - { - return $this->google_managed; - } - - /** - * Output only. Denotes that this `ProcessorVersion` is managed by Google. - * - * Generated from protobuf field bool google_managed = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setGoogleManaged($var) - { - GPBUtil::checkBool($var); - $this->google_managed = $var; - - return $this; - } - - /** - * If set, information about the eventual deprecation of this version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; - * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion\DeprecationInfo|null - */ - public function getDeprecationInfo() - { - return $this->deprecation_info; - } - - public function hasDeprecationInfo() - { - return isset($this->deprecation_info); - } - - public function clearDeprecationInfo() - { - unset($this->deprecation_info); - } - - /** - * If set, information about the eventual deprecation of this version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo deprecation_info = 13; - * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion\DeprecationInfo $var - * @return $this - */ - public function setDeprecationInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\DeprecationInfo::class); - $this->deprecation_info = $var; - - return $this; - } - - /** - * Output only. The model type of this processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.ModelType model_type = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getModelType() - { - return $this->model_type; - } - - /** - * Output only. The model type of this processor version. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.ModelType model_type = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setModelType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\ModelType::class); - $this->model_type = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzs() - { - return $this->satisfies_pzs; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzs = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzs($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzs = $var; - - return $this; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getSatisfiesPzi() - { - return $this->satisfies_pzi; - } - - /** - * Output only. Reserved for future use. - * - * Generated from protobuf field bool satisfies_pzi = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setSatisfiesPzi($var) - { - GPBUtil::checkBool($var); - $this->satisfies_pzi = $var; - - return $this; - } - - /** - * Output only. Information about Generative AI model-based processor - * versions. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo|null - */ - public function getGenAiModelInfo() - { - return $this->gen_ai_model_info; - } - - public function hasGenAiModelInfo() - { - return isset($this->gen_ai_model_info); - } - - public function clearGenAiModelInfo() - { - unset($this->gen_ai_model_info); - } - - /** - * Output only. Information about Generative AI model-based processor - * versions. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo gen_ai_model_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo $var - * @return $this - */ - public function setGenAiModelInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion\GenAiModelInfo::class); - $this->gen_ai_model_info = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/DeprecationInfo.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/DeprecationInfo.php deleted file mode 100644 index f6d07ebc1de2..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/DeprecationInfo.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - */ -class DeprecationInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The time at which this processor version will be deprecated. - * - * Generated from protobuf field .google.protobuf.Timestamp deprecation_time = 1; - */ - protected $deprecation_time = null; - /** - * If set, the processor version that will be used as a replacement. - * - * Generated from protobuf field string replacement_processor_version = 2 [(.google.api.resource_reference) = { - */ - protected $replacement_processor_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $deprecation_time - * The time at which this processor version will be deprecated. - * @type string $replacement_processor_version - * If set, the processor version that will be used as a replacement. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); - parent::__construct($data); - } - - /** - * The time at which this processor version will be deprecated. - * - * Generated from protobuf field .google.protobuf.Timestamp deprecation_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeprecationTime() - { - return $this->deprecation_time; - } - - public function hasDeprecationTime() - { - return isset($this->deprecation_time); - } - - public function clearDeprecationTime() - { - unset($this->deprecation_time); - } - - /** - * The time at which this processor version will be deprecated. - * - * Generated from protobuf field .google.protobuf.Timestamp deprecation_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeprecationTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->deprecation_time = $var; - - return $this; - } - - /** - * If set, the processor version that will be used as a replacement. - * - * Generated from protobuf field string replacement_processor_version = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getReplacementProcessorVersion() - { - return $this->replacement_processor_version; - } - - /** - * If set, the processor version that will be used as a replacement. - * - * Generated from protobuf field string replacement_processor_version = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setReplacementProcessorVersion($var) - { - GPBUtil::checkString($var, True); - $this->replacement_processor_version = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DeprecationInfo::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_DeprecationInfo::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/ModelType.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/ModelType.php deleted file mode 100644 index 01dae38d59e2..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/ModelType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.documentai.v1.ProcessorVersion.ModelType - */ -class ModelType -{ - /** - * The processor version has unspecified model type. - * - * Generated from protobuf enum MODEL_TYPE_UNSPECIFIED = 0; - */ - const MODEL_TYPE_UNSPECIFIED = 0; - /** - * The processor version has generative model type. - * - * Generated from protobuf enum MODEL_TYPE_GENERATIVE = 1; - */ - const MODEL_TYPE_GENERATIVE = 1; - /** - * The processor version has custom model type. - * - * Generated from protobuf enum MODEL_TYPE_CUSTOM = 2; - */ - const MODEL_TYPE_CUSTOM = 2; - - private static $valueToName = [ - self::MODEL_TYPE_UNSPECIFIED => 'MODEL_TYPE_UNSPECIFIED', - self::MODEL_TYPE_GENERATIVE => 'MODEL_TYPE_GENERATIVE', - self::MODEL_TYPE_CUSTOM => 'MODEL_TYPE_CUSTOM', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ModelType::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_ModelType::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/State.php deleted file mode 100644 index 3c740d1f1bb4..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersion/State.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.documentai.v1.ProcessorVersion.State - */ -class State -{ - /** - * The processor version is in an unspecified state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The processor version is deployed and can be used for processing. - * - * Generated from protobuf enum DEPLOYED = 1; - */ - const DEPLOYED = 1; - /** - * The processor version is being deployed. - * - * Generated from protobuf enum DEPLOYING = 2; - */ - const DEPLOYING = 2; - /** - * The processor version is not deployed and cannot be used for processing. - * - * Generated from protobuf enum UNDEPLOYED = 3; - */ - const UNDEPLOYED = 3; - /** - * The processor version is being undeployed. - * - * Generated from protobuf enum UNDEPLOYING = 4; - */ - const UNDEPLOYING = 4; - /** - * The processor version is being created. - * - * Generated from protobuf enum CREATING = 5; - */ - const CREATING = 5; - /** - * The processor version is being deleted. - * - * Generated from protobuf enum DELETING = 6; - */ - const DELETING = 6; - /** - * The processor version failed and is in an indeterminate state. - * - * Generated from protobuf enum FAILED = 7; - */ - const FAILED = 7; - /** - * The processor version is being imported. - * - * Generated from protobuf enum IMPORTING = 8; - */ - const IMPORTING = 8; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::DEPLOYED => 'DEPLOYED', - self::DEPLOYING => 'DEPLOYING', - self::UNDEPLOYED => 'UNDEPLOYED', - self::UNDEPLOYING => 'UNDEPLOYING', - self::CREATING => 'CREATING', - self::DELETING => 'DELETING', - self::FAILED => 'FAILED', - self::IMPORTING => 'IMPORTING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\DocumentAI\V1\ProcessorVersion_State::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersionAlias.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersionAlias.php deleted file mode 100644 index 704c750728bf..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ProcessorVersionAlias.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.documentai.v1.ProcessorVersionAlias - */ -class ProcessorVersionAlias extends \Google\Protobuf\Internal\Message -{ - /** - * The alias in the form of `processor_version` resource name. - * - * Generated from protobuf field string alias = 1; - */ - protected $alias = ''; - /** - * The resource name of aliased processor version. - * - * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { - */ - protected $processor_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $alias - * The alias in the form of `processor_version` resource name. - * @type string $processor_version - * The resource name of aliased processor version. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Processor::initOnce(); - parent::__construct($data); - } - - /** - * The alias in the form of `processor_version` resource name. - * - * Generated from protobuf field string alias = 1; - * @return string - */ - public function getAlias() - { - return $this->alias; - } - - /** - * The alias in the form of `processor_version` resource name. - * - * Generated from protobuf field string alias = 1; - * @param string $var - * @return $this - */ - public function setAlias($var) - { - GPBUtil::checkString($var, True); - $this->alias = $var; - - return $this; - } - - /** - * The resource name of aliased processor version. - * - * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getProcessorVersion() - { - return $this->processor_version; - } - - /** - * The resource name of aliased processor version. - * - * Generated from protobuf field string processor_version = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProcessorVersion($var) - { - GPBUtil::checkString($var, True); - $this->processor_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/RawDocument.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/RawDocument.php deleted file mode 100644 index efe1134b293f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/RawDocument.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.documentai.v1.RawDocument - */ -class RawDocument extends \Google\Protobuf\Internal\Message -{ - /** - * Inline document content. - * - * Generated from protobuf field bytes content = 1; - */ - protected $content = ''; - /** - * An IANA MIME type (RFC6838) indicating the nature and format of the - * [content][google.cloud.documentai.v1.RawDocument.content]. - * - * Generated from protobuf field string mime_type = 2; - */ - protected $mime_type = ''; - /** - * The display name of the document, it supports all Unicode characters except - * the following: - * `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` - * `~`, `=` and `:` are reserved. - * If not specified, a default ID is generated. - * - * Generated from protobuf field string display_name = 3; - */ - protected $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content - * Inline document content. - * @type string $mime_type - * An IANA MIME type (RFC6838) indicating the nature and format of the - * [content][google.cloud.documentai.v1.RawDocument.content]. - * @type string $display_name - * The display name of the document, it supports all Unicode characters except - * the following: - * `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` - * `~`, `=` and `:` are reserved. - * If not specified, a default ID is generated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentIo::initOnce(); - parent::__construct($data); - } - - /** - * Inline document content. - * - * Generated from protobuf field bytes content = 1; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * Inline document content. - * - * Generated from protobuf field bytes content = 1; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, False); - $this->content = $var; - - return $this; - } - - /** - * An IANA MIME type (RFC6838) indicating the nature and format of the - * [content][google.cloud.documentai.v1.RawDocument.content]. - * - * Generated from protobuf field string mime_type = 2; - * @return string - */ - public function getMimeType() - { - return $this->mime_type; - } - - /** - * An IANA MIME type (RFC6838) indicating the nature and format of the - * [content][google.cloud.documentai.v1.RawDocument.content]. - * - * Generated from protobuf field string mime_type = 2; - * @param string $var - * @return $this - */ - public function setMimeType($var) - { - GPBUtil::checkString($var, True); - $this->mime_type = $var; - - return $this; - } - - /** - * The display name of the document, it supports all Unicode characters except - * the following: - * `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` - * `~`, `=` and `:` are reserved. - * If not specified, a default ID is generated. - * - * Generated from protobuf field string display_name = 3; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The display name of the document, it supports all Unicode characters except - * the following: - * `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` - * `~`, `=` and `:` are reserved. - * If not specified, a default ID is generated. - * - * Generated from protobuf field string display_name = 3; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentOperationMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentOperationMetadata.php deleted file mode 100644 index e367e4513d12..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentOperationMetadata.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.documentai.v1.ReviewDocumentOperationMetadata - */ -class ReviewDocumentOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - */ - protected $common_metadata = null; - /** - * The Crowd Compute question ID. - * - * Generated from protobuf field string question_id = 6; - */ - protected $question_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * @type string $question_id - * The Crowd Compute question ID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 5; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - - /** - * The Crowd Compute question ID. - * - * Generated from protobuf field string question_id = 6; - * @return string - */ - public function getQuestionId() - { - return $this->question_id; - } - - /** - * The Crowd Compute question ID. - * - * Generated from protobuf field string question_id = 6; - * @param string $var - * @return $this - */ - public function setQuestionId($var) - { - GPBUtil::checkString($var, True); - $this->question_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest.php deleted file mode 100644 index 9e4a1bf7c987..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest.php +++ /dev/null @@ -1,247 +0,0 @@ -google.cloud.documentai.v1.ReviewDocumentRequest - */ -class ReviewDocumentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - * document will be reviewed with. - * - * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $human_review_config = ''; - /** - * Whether the validation should be performed on the ad-hoc review request. - * - * Generated from protobuf field bool enable_schema_validation = 3; - */ - protected $enable_schema_validation = false; - /** - * The priority of the human review task. - * - * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentRequest.Priority priority = 5; - */ - protected $priority = 0; - /** - * The document schema of the human review task. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 6; - */ - protected $document_schema = null; - protected $source; - - /** - * @param string $humanReviewConfig Required. The resource name of the - * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - * document will be reviewed with. Please see - * {@see DocumentProcessorServiceClient::humanReviewConfigName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest - * - * @experimental - */ - public static function build(string $humanReviewConfig): self - { - return (new self()) - ->setHumanReviewConfig($humanReviewConfig); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\Document $inline_document - * An inline document proto. - * @type string $human_review_config - * Required. The resource name of the - * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - * document will be reviewed with. - * @type bool $enable_schema_validation - * Whether the validation should be performed on the ad-hoc review request. - * @type int $priority - * The priority of the human review task. - * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $document_schema - * The document schema of the human review task. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * An inline document proto. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document inline_document = 4; - * @return \Google\Cloud\DocumentAI\V1\Document|null - */ - public function getInlineDocument() - { - return $this->readOneof(4); - } - - public function hasInlineDocument() - { - return $this->hasOneof(4); - } - - /** - * An inline document proto. - * - * Generated from protobuf field .google.cloud.documentai.v1.Document inline_document = 4; - * @param \Google\Cloud\DocumentAI\V1\Document $var - * @return $this - */ - public function setInlineDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Required. The resource name of the - * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - * document will be reviewed with. - * - * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getHumanReviewConfig() - { - return $this->human_review_config; - } - - /** - * Required. The resource name of the - * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - * document will be reviewed with. - * - * Generated from protobuf field string human_review_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setHumanReviewConfig($var) - { - GPBUtil::checkString($var, True); - $this->human_review_config = $var; - - return $this; - } - - /** - * Whether the validation should be performed on the ad-hoc review request. - * - * Generated from protobuf field bool enable_schema_validation = 3; - * @return bool - */ - public function getEnableSchemaValidation() - { - return $this->enable_schema_validation; - } - - /** - * Whether the validation should be performed on the ad-hoc review request. - * - * Generated from protobuf field bool enable_schema_validation = 3; - * @param bool $var - * @return $this - */ - public function setEnableSchemaValidation($var) - { - GPBUtil::checkBool($var); - $this->enable_schema_validation = $var; - - return $this; - } - - /** - * The priority of the human review task. - * - * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentRequest.Priority priority = 5; - * @return int - */ - public function getPriority() - { - return $this->priority; - } - - /** - * The priority of the human review task. - * - * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentRequest.Priority priority = 5; - * @param int $var - * @return $this - */ - public function setPriority($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest\Priority::class); - $this->priority = $var; - - return $this; - } - - /** - * The document schema of the human review task. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 6; - * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null - */ - public function getDocumentSchema() - { - return $this->document_schema; - } - - public function hasDocumentSchema() - { - return isset($this->document_schema); - } - - public function clearDocumentSchema() - { - unset($this->document_schema); - } - - /** - * The document schema of the human review task. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 6; - * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var - * @return $this - */ - public function setDocumentSchema($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema::class); - $this->document_schema = $var; - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest/Priority.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest/Priority.php deleted file mode 100644 index 41929b863a9d..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentRequest/Priority.php +++ /dev/null @@ -1,62 +0,0 @@ -google.cloud.documentai.v1.ReviewDocumentRequest.Priority - */ -class Priority -{ - /** - * The default priority level. - * - * Generated from protobuf enum DEFAULT = 0; - */ - const PBDEFAULT = 0; - /** - * The urgent priority level. The labeling manager should allocate labeler - * resource to the urgent task queue to respect this priority level. - * - * Generated from protobuf enum URGENT = 1; - */ - const URGENT = 1; - - private static $valueToName = [ - self::PBDEFAULT => 'DEFAULT', - self::URGENT => 'URGENT', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Priority::class, \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest_Priority::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse.php deleted file mode 100644 index 660f9271b9a6..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.documentai.v1.ReviewDocumentResponse - */ -class ReviewDocumentResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The Cloud Storage uri for the human reviewed document if the review is - * succeeded. - * - * Generated from protobuf field string gcs_destination = 1; - */ - protected $gcs_destination = ''; - /** - * The state of the review operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; - */ - protected $state = 0; - /** - * The reason why the review is rejected by reviewer. - * - * Generated from protobuf field string rejection_reason = 3; - */ - protected $rejection_reason = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $gcs_destination - * The Cloud Storage uri for the human reviewed document if the review is - * succeeded. - * @type int $state - * The state of the review operation. - * @type string $rejection_reason - * The reason why the review is rejected by reviewer. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The Cloud Storage uri for the human reviewed document if the review is - * succeeded. - * - * Generated from protobuf field string gcs_destination = 1; - * @return string - */ - public function getGcsDestination() - { - return $this->gcs_destination; - } - - /** - * The Cloud Storage uri for the human reviewed document if the review is - * succeeded. - * - * Generated from protobuf field string gcs_destination = 1; - * @param string $var - * @return $this - */ - public function setGcsDestination($var) - { - GPBUtil::checkString($var, True); - $this->gcs_destination = $var; - - return $this; - } - - /** - * The state of the review operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The state of the review operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.ReviewDocumentResponse.State state = 2; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\ReviewDocumentResponse\State::class); - $this->state = $var; - - return $this; - } - - /** - * The reason why the review is rejected by reviewer. - * - * Generated from protobuf field string rejection_reason = 3; - * @return string - */ - public function getRejectionReason() - { - return $this->rejection_reason; - } - - /** - * The reason why the review is rejected by reviewer. - * - * Generated from protobuf field string rejection_reason = 3; - * @param string $var - * @return $this - */ - public function setRejectionReason($var) - { - GPBUtil::checkString($var, True); - $this->rejection_reason = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse/State.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse/State.php deleted file mode 100644 index 89dda0791451..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/ReviewDocumentResponse/State.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.documentai.v1.ReviewDocumentResponse.State - */ -class State -{ - /** - * The default value. This value is used if the state is omitted. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The review operation is rejected by the reviewer. - * - * Generated from protobuf enum REJECTED = 1; - */ - const REJECTED = 1; - /** - * The review operation is succeeded. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::REJECTED => 'REJECTED', - self::SUCCEEDED => 'SUCCEEDED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\DocumentAI\V1\ReviewDocumentResponse_State::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionMetadata.php deleted file mode 100644 index 6830b29e2510..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionMetadata.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - */ -class SetDefaultProcessorVersionMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - */ - protected $common_metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionRequest.php deleted file mode 100644 index 3ec67a74150a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionRequest.php +++ /dev/null @@ -1,123 +0,0 @@ -google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - */ -class SetDefaultProcessorVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] to change default - * version. - * - * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $processor = ''; - /** - * Required. The resource name of child - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as - * default. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - * - * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $default_processor_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $processor - * Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] to change default - * version. - * @type string $default_processor_version - * Required. The resource name of child - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as - * default. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] to change default - * version. - * - * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getProcessor() - { - return $this->processor; - } - - /** - * Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] to change default - * version. - * - * Generated from protobuf field string processor = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProcessor($var) - { - GPBUtil::checkString($var, True); - $this->processor = $var; - - return $this; - } - - /** - * Required. The resource name of child - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as - * default. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - * - * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getDefaultProcessorVersion() - { - return $this->default_processor_version; - } - - /** - * Required. The resource name of child - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as - * default. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - * - * Generated from protobuf field string default_processor_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDefaultProcessorVersion($var) - { - GPBUtil::checkString($var, True); - $this->default_processor_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionResponse.php deleted file mode 100644 index 99dada608c4d..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/SetDefaultProcessorVersionResponse.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - */ -class SetDefaultProcessorVersionResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata.php deleted file mode 100644 index b7ef781099da..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata.php +++ /dev/null @@ -1,165 +0,0 @@ -google.cloud.documentai.v1.TrainProcessorVersionMetadata - */ -class TrainProcessorVersionMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - */ - protected $common_metadata = null; - /** - * The training dataset validation information. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; - */ - protected $training_dataset_validation = null; - /** - * The test dataset validation information. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; - */ - protected $test_dataset_validation = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation $training_dataset_validation - * The training dataset validation information. - * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation $test_dataset_validation - * The test dataset validation information. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - - /** - * The training dataset validation information. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; - * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation|null - */ - public function getTrainingDatasetValidation() - { - return $this->training_dataset_validation; - } - - public function hasTrainingDatasetValidation() - { - return isset($this->training_dataset_validation); - } - - public function clearTrainingDatasetValidation() - { - unset($this->training_dataset_validation); - } - - /** - * The training dataset validation information. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation training_dataset_validation = 2; - * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation $var - * @return $this - */ - public function setTrainingDatasetValidation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation::class); - $this->training_dataset_validation = $var; - - return $this; - } - - /** - * The test dataset validation information. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; - * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation|null - */ - public function getTestDatasetValidation() - { - return $this->test_dataset_validation; - } - - public function hasTestDatasetValidation() - { - return isset($this->test_dataset_validation); - } - - public function clearTestDatasetValidation() - { - unset($this->test_dataset_validation); - } - - /** - * The test dataset validation information. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation test_dataset_validation = 3; - * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation $var - * @return $this - */ - public function setTestDatasetValidation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata\DatasetValidation::class); - $this->test_dataset_validation = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata/DatasetValidation.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata/DatasetValidation.php deleted file mode 100644 index c30b51c24dfe..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionMetadata/DatasetValidation.php +++ /dev/null @@ -1,189 +0,0 @@ -google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - */ -class DatasetValidation extends \Google\Protobuf\Internal\Message -{ - /** - * The total number of document errors. - * - * Generated from protobuf field int32 document_error_count = 3; - */ - protected $document_error_count = 0; - /** - * The total number of dataset errors. - * - * Generated from protobuf field int32 dataset_error_count = 4; - */ - protected $dataset_error_count = 0; - /** - * Error information pertaining to specific documents. A maximum of 10 - * document errors will be returned. - * Any document with errors will not be used throughout training. - * - * Generated from protobuf field repeated .google.rpc.Status document_errors = 1; - */ - private $document_errors; - /** - * Error information for the dataset as a whole. A maximum of 10 dataset - * errors will be returned. - * A single dataset error is terminal for training. - * - * Generated from protobuf field repeated .google.rpc.Status dataset_errors = 2; - */ - private $dataset_errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $document_error_count - * The total number of document errors. - * @type int $dataset_error_count - * The total number of dataset errors. - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $document_errors - * Error information pertaining to specific documents. A maximum of 10 - * document errors will be returned. - * Any document with errors will not be used throughout training. - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $dataset_errors - * Error information for the dataset as a whole. A maximum of 10 dataset - * errors will be returned. - * A single dataset error is terminal for training. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The total number of document errors. - * - * Generated from protobuf field int32 document_error_count = 3; - * @return int - */ - public function getDocumentErrorCount() - { - return $this->document_error_count; - } - - /** - * The total number of document errors. - * - * Generated from protobuf field int32 document_error_count = 3; - * @param int $var - * @return $this - */ - public function setDocumentErrorCount($var) - { - GPBUtil::checkInt32($var); - $this->document_error_count = $var; - - return $this; - } - - /** - * The total number of dataset errors. - * - * Generated from protobuf field int32 dataset_error_count = 4; - * @return int - */ - public function getDatasetErrorCount() - { - return $this->dataset_error_count; - } - - /** - * The total number of dataset errors. - * - * Generated from protobuf field int32 dataset_error_count = 4; - * @param int $var - * @return $this - */ - public function setDatasetErrorCount($var) - { - GPBUtil::checkInt32($var); - $this->dataset_error_count = $var; - - return $this; - } - - /** - * Error information pertaining to specific documents. A maximum of 10 - * document errors will be returned. - * Any document with errors will not be used throughout training. - * - * Generated from protobuf field repeated .google.rpc.Status document_errors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDocumentErrors() - { - return $this->document_errors; - } - - /** - * Error information pertaining to specific documents. A maximum of 10 - * document errors will be returned. - * Any document with errors will not be used throughout training. - * - * Generated from protobuf field repeated .google.rpc.Status document_errors = 1; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDocumentErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->document_errors = $arr; - - return $this; - } - - /** - * Error information for the dataset as a whole. A maximum of 10 dataset - * errors will be returned. - * A single dataset error is terminal for training. - * - * Generated from protobuf field repeated .google.rpc.Status dataset_errors = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDatasetErrors() - { - return $this->dataset_errors; - } - - /** - * Error information for the dataset as a whole. A maximum of 10 dataset - * errors will be returned. - * A single dataset error is terminal for training. - * - * Generated from protobuf field repeated .google.rpc.Status dataset_errors = 2; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDatasetErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->dataset_errors = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatasetValidation::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata_DatasetValidation::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest.php deleted file mode 100644 index c718cdbac2a7..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest.php +++ /dev/null @@ -1,348 +0,0 @@ -google.cloud.documentai.v1.TrainProcessorVersionRequest - */ -class TrainProcessorVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The processor version to be created. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $processor_version = null; - /** - * Optional. The schema the processor version will be trained with. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $document_schema = null; - /** - * Optional. The input data used to train the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $input_data = null; - /** - * Optional. The processor version to use as a base for training. This - * processor version must be a child of `parent`. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - * - * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $base_processor_version = ''; - protected $processor_flags; - - /** - * @param string $parent Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. Please see - * {@see DocumentProcessorServiceClient::processorName()} for help formatting this field. - * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion $processorVersion Required. The processor version to be created. - * - * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\DocumentAI\V1\ProcessorVersion $processorVersion): self - { - return (new self()) - ->setParent($parent) - ->setProcessorVersion($processorVersion); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions $custom_document_extraction_options - * Options to control Custom Document Extraction (CDE) Processor. - * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions $foundation_model_tuning_options - * Options to control foundation model tuning of a processor. - * @type string $parent - * Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - * @type \Google\Cloud\DocumentAI\V1\ProcessorVersion $processor_version - * Required. The processor version to be created. - * @type \Google\Cloud\DocumentAI\V1\DocumentSchema $document_schema - * Optional. The schema the processor version will be trained with. - * @type \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData $input_data - * Optional. The input data used to train the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * @type string $base_processor_version - * Optional. The processor version to use as a base for training. This - * processor version must be a child of `parent`. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Options to control Custom Document Extraction (CDE) Processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions custom_document_extraction_options = 5; - * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions|null - */ - public function getCustomDocumentExtractionOptions() - { - return $this->readOneof(5); - } - - public function hasCustomDocumentExtractionOptions() - { - return $this->hasOneof(5); - } - - /** - * Options to control Custom Document Extraction (CDE) Processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions custom_document_extraction_options = 5; - * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions $var - * @return $this - */ - public function setCustomDocumentExtractionOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Options to control foundation model tuning of a processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions foundation_model_tuning_options = 12; - * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions|null - */ - public function getFoundationModelTuningOptions() - { - return $this->readOneof(12); - } - - public function hasFoundationModelTuningOptions() - { - return $this->hasOneof(12); - } - - /** - * Options to control foundation model tuning of a processor. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions foundation_model_tuning_options = 12; - * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions $var - * @return $this - */ - public function setFoundationModelTuningOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\FoundationModelTuningOptions::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The processor version to be created. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion|null - */ - public function getProcessorVersion() - { - return $this->processor_version; - } - - public function hasProcessorVersion() - { - return isset($this->processor_version); - } - - public function clearProcessorVersion() - { - unset($this->processor_version); - } - - /** - * Required. The processor version to be created. - * - * Generated from protobuf field .google.cloud.documentai.v1.ProcessorVersion processor_version = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DocumentAI\V1\ProcessorVersion $var - * @return $this - */ - public function setProcessorVersion($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\ProcessorVersion::class); - $this->processor_version = $var; - - return $this; - } - - /** - * Optional. The schema the processor version will be trained with. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\DocumentSchema|null - */ - public function getDocumentSchema() - { - return $this->document_schema; - } - - public function hasDocumentSchema() - { - return isset($this->document_schema); - } - - public function clearDocumentSchema() - { - unset($this->document_schema); - } - - /** - * Optional. The schema the processor version will be trained with. - * - * Generated from protobuf field .google.cloud.documentai.v1.DocumentSchema document_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\DocumentSchema $var - * @return $this - */ - public function setDocumentSchema($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema::class); - $this->document_schema = $var; - - return $this; - } - - /** - * Optional. The input data used to train the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData|null - */ - public function getInputData() - { - return $this->input_data; - } - - public function hasInputData() - { - return isset($this->input_data); - } - - public function clearInputData() - { - unset($this->input_data); - } - - /** - * Optional. The input data used to train the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData input_data = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData $var - * @return $this - */ - public function setInputData($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\InputData::class); - $this->input_data = $var; - - return $this; - } - - /** - * Optional. The processor version to use as a base for training. This - * processor version must be a child of `parent`. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - * - * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getBaseProcessorVersion() - { - return $this->base_processor_version; - } - - /** - * Optional. The processor version to use as a base for training. This - * processor version must be a child of `parent`. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - * - * Generated from protobuf field string base_processor_version = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setBaseProcessorVersion($var) - { - GPBUtil::checkString($var, True); - $this->base_processor_version = $var; - - return $this; - } - - /** - * @return string - */ - public function getProcessorFlags() - { - return $this->whichOneof("processor_flags"); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php deleted file mode 100644 index d3323c332634..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - */ -class CustomDocumentExtractionOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Training method to use for CDE training. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; - */ - protected $training_method = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $training_method - * Training method to use for CDE training. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Training method to use for CDE training. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; - * @return int - */ - public function getTrainingMethod() - { - return $this->training_method; - } - - /** - * Training method to use for CDE training. - * - * Generated from protobuf field .google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod training_method = 3; - * @param int $var - * @return $this - */ - public function setTrainingMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest\CustomDocumentExtractionOptions\TrainingMethod::class); - $this->training_method = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CustomDocumentExtractionOptions::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest_CustomDocumentExtractionOptions::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php deleted file mode 100644 index 67f7b58ff0e9..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/CustomDocumentExtractionOptions/TrainingMethod.php +++ /dev/null @@ -1,59 +0,0 @@ -google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod - */ -class TrainingMethod -{ - /** - * Generated from protobuf enum TRAINING_METHOD_UNSPECIFIED = 0; - */ - const TRAINING_METHOD_UNSPECIFIED = 0; - /** - * Generated from protobuf enum MODEL_BASED = 1; - */ - const MODEL_BASED = 1; - /** - * Generated from protobuf enum TEMPLATE_BASED = 2; - */ - const TEMPLATE_BASED = 2; - - private static $valueToName = [ - self::TRAINING_METHOD_UNSPECIFIED => 'TRAINING_METHOD_UNSPECIFIED', - self::MODEL_BASED => 'MODEL_BASED', - self::TEMPLATE_BASED => 'TEMPLATE_BASED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TrainingMethod::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest_CustomDocumentExtractionOptions_TrainingMethod::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php deleted file mode 100644 index ff45cadfee71..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/FoundationModelTuningOptions.php +++ /dev/null @@ -1,116 +0,0 @@ -google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - */ -class FoundationModelTuningOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The number of steps to run for model tuning. Valid values are - * between 1 and 400. If not provided, recommended steps will be used. - * - * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $train_steps = 0; - /** - * Optional. The multiplier to apply to the recommended learning rate. Valid - * values are between 0.1 and 10. If not provided, recommended learning rate - * will be used. - * - * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $learning_rate_multiplier = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $train_steps - * Optional. The number of steps to run for model tuning. Valid values are - * between 1 and 400. If not provided, recommended steps will be used. - * @type float $learning_rate_multiplier - * Optional. The multiplier to apply to the recommended learning rate. Valid - * values are between 0.1 and 10. If not provided, recommended learning rate - * will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The number of steps to run for model tuning. Valid values are - * between 1 and 400. If not provided, recommended steps will be used. - * - * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getTrainSteps() - { - return $this->train_steps; - } - - /** - * Optional. The number of steps to run for model tuning. Valid values are - * between 1 and 400. If not provided, recommended steps will be used. - * - * Generated from protobuf field int32 train_steps = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setTrainSteps($var) - { - GPBUtil::checkInt32($var); - $this->train_steps = $var; - - return $this; - } - - /** - * Optional. The multiplier to apply to the recommended learning rate. Valid - * values are between 0.1 and 10. If not provided, recommended learning rate - * will be used. - * - * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getLearningRateMultiplier() - { - return $this->learning_rate_multiplier; - } - - /** - * Optional. The multiplier to apply to the recommended learning rate. Valid - * values are between 0.1 and 10. If not provided, recommended learning rate - * will be used. - * - * Generated from protobuf field float learning_rate_multiplier = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setLearningRateMultiplier($var) - { - GPBUtil::checkFloat($var); - $this->learning_rate_multiplier = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FoundationModelTuningOptions::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest_FoundationModelTuningOptions::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/InputData.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/InputData.php deleted file mode 100644 index c1a4db267951..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionRequest/InputData.php +++ /dev/null @@ -1,125 +0,0 @@ -google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - */ -class InputData extends \Google\Protobuf\Internal\Message -{ - /** - * The documents used for training the new version. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; - */ - protected $training_documents = null; - /** - * The documents used for testing the trained version. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; - */ - protected $test_documents = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $training_documents - * The documents used for training the new version. - * @type \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $test_documents - * The documents used for testing the trained version. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The documents used for training the new version. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; - * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null - */ - public function getTrainingDocuments() - { - return $this->training_documents; - } - - public function hasTrainingDocuments() - { - return isset($this->training_documents); - } - - public function clearTrainingDocuments() - { - unset($this->training_documents); - } - - /** - * The documents used for training the new version. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig training_documents = 3; - * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var - * @return $this - */ - public function setTrainingDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig::class); - $this->training_documents = $var; - - return $this; - } - - /** - * The documents used for testing the trained version. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; - * @return \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig|null - */ - public function getTestDocuments() - { - return $this->test_documents; - } - - public function hasTestDocuments() - { - return isset($this->test_documents); - } - - public function clearTestDocuments() - { - unset($this->test_documents); - } - - /** - * The documents used for testing the trained version. - * - * Generated from protobuf field .google.cloud.documentai.v1.BatchDocumentsInputConfig test_documents = 4; - * @param \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig $var - * @return $this - */ - public function setTestDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\BatchDocumentsInputConfig::class); - $this->test_documents = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InputData::class, \Google\Cloud\DocumentAI\V1\TrainProcessorVersionRequest_InputData::class); - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionResponse.php deleted file mode 100644 index c46c6b822b85..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/TrainProcessorVersionResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.documentai.v1.TrainProcessorVersionResponse - */ -class TrainProcessorVersionResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the processor version produced by training. - * - * Generated from protobuf field string processor_version = 1; - */ - protected $processor_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $processor_version - * The resource name of the processor version produced by training. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the processor version produced by training. - * - * Generated from protobuf field string processor_version = 1; - * @return string - */ - public function getProcessorVersion() - { - return $this->processor_version; - } - - /** - * The resource name of the processor version produced by training. - * - * Generated from protobuf field string processor_version = 1; - * @param string $var - * @return $this - */ - public function setProcessorVersion($var) - { - GPBUtil::checkString($var, True); - $this->processor_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionMetadata.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionMetadata.php deleted file mode 100644 index 7b046ed6c93b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionMetadata.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.documentai.v1.UndeployProcessorVersionMetadata - */ -class UndeployProcessorVersionMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - */ - protected $common_metadata = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $common_metadata - * The basic metadata of the long-running operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @return \Google\Cloud\DocumentAI\V1\CommonOperationMetadata|null - */ - public function getCommonMetadata() - { - return $this->common_metadata; - } - - public function hasCommonMetadata() - { - return isset($this->common_metadata); - } - - public function clearCommonMetadata() - { - unset($this->common_metadata); - } - - /** - * The basic metadata of the long-running operation. - * - * Generated from protobuf field .google.cloud.documentai.v1.CommonOperationMetadata common_metadata = 1; - * @param \Google\Cloud\DocumentAI\V1\CommonOperationMetadata $var - * @return $this - */ - public function setCommonMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\CommonOperationMetadata::class); - $this->common_metadata = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionRequest.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionRequest.php deleted file mode 100644 index 1c5cb20ed5f8..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.documentai.v1.UndeployProcessorVersionRequest - */ -class UndeployProcessorVersionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The processor version resource name to be undeployed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The processor version resource name to be undeployed. Please see - * {@see DocumentProcessorServiceClient::processorVersionName()} for help formatting this field. - * - * @return \Google\Cloud\DocumentAI\V1\UndeployProcessorVersionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The processor version resource name to be undeployed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The processor version resource name to be undeployed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The processor version resource name to be undeployed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionResponse.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionResponse.php deleted file mode 100644 index e6d592d8b55a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/UndeployProcessorVersionResponse.php +++ /dev/null @@ -1,35 +0,0 @@ -google.cloud.documentai.v1.UndeployProcessorVersionResponse - */ -class UndeployProcessorVersionResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\DocumentProcessorService::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Vertex.php b/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Vertex.php deleted file mode 100644 index d56818347c95..000000000000 --- a/owl-bot-staging/DocumentAi/v1/proto/src/Google/Cloud/DocumentAI/V1/Vertex.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.documentai.v1.Vertex - */ -class Vertex extends \Google\Protobuf\Internal\Message -{ - /** - * X coordinate. - * - * Generated from protobuf field int32 x = 1; - */ - protected $x = 0; - /** - * Y coordinate (starts from the top of the image). - * - * Generated from protobuf field int32 y = 2; - */ - protected $y = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $x - * X coordinate. - * @type int $y - * Y coordinate (starts from the top of the image). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Documentai\V1\Geometry::initOnce(); - parent::__construct($data); - } - - /** - * X coordinate. - * - * Generated from protobuf field int32 x = 1; - * @return int - */ - public function getX() - { - return $this->x; - } - - /** - * X coordinate. - * - * Generated from protobuf field int32 x = 1; - * @param int $var - * @return $this - */ - public function setX($var) - { - GPBUtil::checkInt32($var); - $this->x = $var; - - return $this; - } - - /** - * Y coordinate (starts from the top of the image). - * - * Generated from protobuf field int32 y = 2; - * @return int - */ - public function getY() - { - return $this->y; - } - - /** - * Y coordinate (starts from the top of the image). - * - * Generated from protobuf field int32 y = 2; - * @param int $var - * @return $this - */ - public function setY($var) - { - GPBUtil::checkInt32($var); - $this->y = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php deleted file mode 100644 index 5c92935d071b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/batch_process_documents.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->batchProcessDocuments($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BatchProcessResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - batch_process_documents_sample($name); -} -// [END documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/create_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/create_processor.php deleted file mode 100644 index cd7f845f943a..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/create_processor.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent) - ->setProcessor($processor); - - // Call the API and handle any network failures. - try { - /** @var Processor $response */ - $response = $documentProcessorServiceClient->createProcessor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentProcessorServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - create_processor_sample($formattedParent); -} -// [END documentai_v1_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor.php deleted file mode 100644 index 627fab2af8e1..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->deleteProcessor($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]' - ); - - delete_processor_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor_version.php deleted file mode 100644 index 5ed8b9048b8f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/delete_processor_version.php +++ /dev/null @@ -1,86 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->deleteProcessorVersion($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorVersionName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]', - '[PROCESSOR_VERSION]' - ); - - delete_processor_version_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php deleted file mode 100644 index 28e1d7e8061c..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->deployProcessorVersion($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var DeployProcessorVersionResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorVersionName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]', - '[PROCESSOR_VERSION]' - ); - - deploy_processor_version_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/disable_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/disable_processor.php deleted file mode 100644 index 60db2b4dc9af..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/disable_processor.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->disableProcessor($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var DisableProcessorResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]' - ); - - disable_processor_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/enable_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/enable_processor.php deleted file mode 100644 index 2ec7bdda6851..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/enable_processor.php +++ /dev/null @@ -1,87 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->enableProcessor($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var EnableProcessorResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]' - ); - - enable_processor_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php deleted file mode 100644 index 90b907983c0f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php +++ /dev/null @@ -1,92 +0,0 @@ -setProcessorVersion($formattedProcessorVersion); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->evaluateProcessorVersion($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var EvaluateProcessorVersionResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProcessorVersion = DocumentProcessorServiceClient::processorVersionName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]', - '[PROCESSOR_VERSION]' - ); - - evaluate_processor_version_sample($formattedProcessorVersion); -} -// [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php deleted file mode 100644 index 7be2f8f45b7b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php +++ /dev/null @@ -1,74 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var FetchProcessorTypesResponse $response */ - $response = $documentProcessorServiceClient->fetchProcessorTypes($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentProcessorServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - fetch_processor_types_sample($formattedParent); -} -// [END documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_evaluation.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_evaluation.php deleted file mode 100644 index 5173e6f5eacf..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_evaluation.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Evaluation $response */ - $response = $documentProcessorServiceClient->getEvaluation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::evaluationName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]', - '[PROCESSOR_VERSION]', - '[EVALUATION]' - ); - - get_evaluation_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_location.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_location.php deleted file mode 100644 index 9d52a912d85b..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END documentai_v1_generated_DocumentProcessorService_GetLocation_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor.php deleted file mode 100644 index a6886cfe7001..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Processor $response */ - $response = $documentProcessorServiceClient->getProcessor($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]' - ); - - get_processor_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_type.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_type.php deleted file mode 100644 index b734a91e4795..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_type.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ProcessorType $response */ - $response = $documentProcessorServiceClient->getProcessorType($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorTypeName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR_TYPE]' - ); - - get_processor_type_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_GetProcessorType_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_version.php deleted file mode 100644 index dc0474ab1064..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/get_processor_version.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var ProcessorVersion $response */ - $response = $documentProcessorServiceClient->getProcessorVersion($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorVersionName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]', - '[PROCESSOR_VERSION]' - ); - - get_processor_version_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_evaluations.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_evaluations.php deleted file mode 100644 index 25c87e832ffb..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_evaluations.php +++ /dev/null @@ -1,84 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $documentProcessorServiceClient->listEvaluations($request); - - /** @var Evaluation $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentProcessorServiceClient::processorVersionName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]', - '[PROCESSOR_VERSION]' - ); - - list_evaluations_sample($formattedParent); -} -// [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_locations.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_locations.php deleted file mode 100644 index 5cbfdbbb5f4f..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END documentai_v1_generated_DocumentProcessorService_ListLocations_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_types.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_types.php deleted file mode 100644 index 3882352e5fe6..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_types.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $documentProcessorServiceClient->listProcessorTypes($request); - - /** @var ProcessorType $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentProcessorServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - list_processor_types_sample($formattedParent); -} -// [END documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php deleted file mode 100644 index 23d07762ebe0..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processor_versions.php +++ /dev/null @@ -1,82 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $documentProcessorServiceClient->listProcessorVersions($request); - - /** @var ProcessorVersion $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentProcessorServiceClient::processorName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]' - ); - - list_processor_versions_sample($formattedParent); -} -// [END documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processors.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processors.php deleted file mode 100644 index 35369a0426d4..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/list_processors.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $documentProcessorServiceClient->listProcessors($request); - - /** @var Processor $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentProcessorServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - list_processors_sample($formattedParent); -} -// [END documentai_v1_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/process_document.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/process_document.php deleted file mode 100644 index 9491299e8723..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/process_document.php +++ /dev/null @@ -1,79 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var ProcessResponse $response */ - $response = $documentProcessorServiceClient->processDocument($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - process_document_sample($name); -} -// [END documentai_v1_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/review_document.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/review_document.php deleted file mode 100644 index 3ff6e2ef5433..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/review_document.php +++ /dev/null @@ -1,90 +0,0 @@ -setHumanReviewConfig($formattedHumanReviewConfig); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->reviewDocument($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ReviewDocumentResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedHumanReviewConfig = DocumentProcessorServiceClient::humanReviewConfigName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]' - ); - - review_document_sample($formattedHumanReviewConfig); -} -// [END documentai_v1_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php deleted file mode 100644 index 5221bc4baf85..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php +++ /dev/null @@ -1,107 +0,0 @@ -setProcessor($formattedProcessor) - ->setDefaultProcessorVersion($formattedDefaultProcessorVersion); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->setDefaultProcessorVersion($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var SetDefaultProcessorVersionResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedProcessor = DocumentProcessorServiceClient::processorName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]' - ); - $formattedDefaultProcessorVersion = DocumentProcessorServiceClient::processorVersionName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]', - '[PROCESSOR_VERSION]' - ); - - set_default_processor_version_sample($formattedProcessor, $formattedDefaultProcessorVersion); -} -// [END documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/train_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/train_processor_version.php deleted file mode 100644 index 94059bc29174..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/train_processor_version.php +++ /dev/null @@ -1,94 +0,0 @@ -setParent($formattedParent) - ->setProcessorVersion($processorVersion); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->trainProcessorVersion($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var TrainProcessorVersionResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = DocumentProcessorServiceClient::processorName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]' - ); - - train_processor_version_sample($formattedParent); -} -// [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php b/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php deleted file mode 100644 index ddee2a4812dd..000000000000 --- a/owl-bot-staging/DocumentAi/v1/samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php +++ /dev/null @@ -1,88 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $documentProcessorServiceClient->undeployProcessorVersion($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var UndeployProcessorVersionResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = DocumentProcessorServiceClient::processorVersionName( - '[PROJECT]', - '[LOCATION]', - '[PROCESSOR]', - '[PROCESSOR_VERSION]' - ); - - undeploy_processor_version_sample($formattedName); -} -// [END documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/Client/DocumentProcessorServiceClient.php b/owl-bot-staging/DocumentAi/v1/src/V1/Client/DocumentProcessorServiceClient.php deleted file mode 100644 index d95b10ee7cdb..000000000000 --- a/owl-bot-staging/DocumentAi/v1/src/V1/Client/DocumentProcessorServiceClient.php +++ /dev/null @@ -1,1075 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/document_processor_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/document_processor_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/document_processor_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/document_processor_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Formats a string containing the fully-qualified path to represent a evaluation - * resource. - * - * @param string $project - * @param string $location - * @param string $processor - * @param string $processorVersion - * @param string $evaluation - * - * @return string The formatted evaluation resource. - */ - public static function evaluationName(string $project, string $location, string $processor, string $processorVersion, string $evaluation): string - { - return self::getPathTemplate('evaluation')->render([ - 'project' => $project, - 'location' => $location, - 'processor' => $processor, - 'processor_version' => $processorVersion, - 'evaluation' => $evaluation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * human_review_config resource. - * - * @param string $project - * @param string $location - * @param string $processor - * - * @return string The formatted human_review_config resource. - */ - public static function humanReviewConfigName(string $project, string $location, string $processor): string - { - return self::getPathTemplate('humanReviewConfig')->render([ - 'project' => $project, - 'location' => $location, - 'processor' => $processor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a processor - * resource. - * - * @param string $project - * @param string $location - * @param string $processor - * - * @return string The formatted processor resource. - */ - public static function processorName(string $project, string $location, string $processor): string - { - return self::getPathTemplate('processor')->render([ - 'project' => $project, - 'location' => $location, - 'processor' => $processor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * processor_type resource. - * - * @param string $project - * @param string $location - * @param string $processorType - * - * @return string The formatted processor_type resource. - */ - public static function processorTypeName(string $project, string $location, string $processorType): string - { - return self::getPathTemplate('processorType')->render([ - 'project' => $project, - 'location' => $location, - 'processor_type' => $processorType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * processor_version resource. - * - * @param string $project - * @param string $location - * @param string $processor - * @param string $processorVersion - * - * @return string The formatted processor_version resource. - */ - public static function processorVersionName(string $project, string $location, string $processor, string $processorVersion): string - { - return self::getPathTemplate('processorVersion')->render([ - 'project' => $project, - 'location' => $location, - 'processor' => $processor, - 'processor_version' => $processorVersion, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - evaluation: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation} - * - humanReviewConfig: projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig - * - location: projects/{project}/locations/{location} - * - processor: projects/{project}/locations/{location}/processors/{processor} - * - processorType: projects/{project}/locations/{location}/processorTypes/{processor_type} - * - processorVersion: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'documentai.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * LRO endpoint to batch process many documents. The output is written - * to Cloud Storage as JSON in the [Document] format. - * - * The async variant is - * {@see DocumentProcessorServiceClient::batchProcessDocumentsAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/batch_process_documents.php - * - * @param BatchProcessRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchProcessDocuments(BatchProcessRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BatchProcessDocuments', $request, $callOptions)->wait(); - } - - /** - * Creates a processor from the - * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The - * processor will be at `ENABLED` state by default after its creation. Note - * that this method requires the `documentai.processors.create` permission on - * the project, which is highly privileged. A user or service account with - * this permission can create new processors that can interact with any gcs - * bucket in your project. - * - * The async variant is - * {@see DocumentProcessorServiceClient::createProcessorAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/create_processor.php - * - * @param CreateProcessorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Processor - * - * @throws ApiException Thrown if the API call fails. - */ - public function createProcessor(CreateProcessorRequest $request, array $callOptions = []): Processor - { - return $this->startApiCall('CreateProcessor', $request, $callOptions)->wait(); - } - - /** - * Deletes the processor, unloads all deployed model artifacts if it was - * enabled and then deletes all artifacts associated with this processor. - * - * The async variant is - * {@see DocumentProcessorServiceClient::deleteProcessorAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/delete_processor.php - * - * @param DeleteProcessorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteProcessor(DeleteProcessorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteProcessor', $request, $callOptions)->wait(); - } - - /** - * Deletes the processor version, all artifacts under the processor version - * will be deleted. - * - * The async variant is - * {@see DocumentProcessorServiceClient::deleteProcessorVersionAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/delete_processor_version.php - * - * @param DeleteProcessorVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteProcessorVersion(DeleteProcessorVersionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteProcessorVersion', $request, $callOptions)->wait(); - } - - /** - * Deploys the processor version. - * - * The async variant is - * {@see DocumentProcessorServiceClient::deployProcessorVersionAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/deploy_processor_version.php - * - * @param DeployProcessorVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deployProcessorVersion(DeployProcessorVersionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeployProcessorVersion', $request, $callOptions)->wait(); - } - - /** - * Disables a processor - * - * The async variant is - * {@see DocumentProcessorServiceClient::disableProcessorAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/disable_processor.php - * - * @param DisableProcessorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function disableProcessor(DisableProcessorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DisableProcessor', $request, $callOptions)->wait(); - } - - /** - * Enables a processor - * - * The async variant is - * {@see DocumentProcessorServiceClient::enableProcessorAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/enable_processor.php - * - * @param EnableProcessorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function enableProcessor(EnableProcessorRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('EnableProcessor', $request, $callOptions)->wait(); - } - - /** - * Evaluates a ProcessorVersion against annotated documents, producing an - * Evaluation. - * - * The async variant is - * {@see DocumentProcessorServiceClient::evaluateProcessorVersionAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/evaluate_processor_version.php - * - * @param EvaluateProcessorVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function evaluateProcessorVersion(EvaluateProcessorVersionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('EvaluateProcessorVersion', $request, $callOptions)->wait(); - } - - /** - * Fetches processor types. Note that we don't use - * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] - * here, because it isn't paginated. - * - * The async variant is - * {@see DocumentProcessorServiceClient::fetchProcessorTypesAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/fetch_processor_types.php - * - * @param FetchProcessorTypesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return FetchProcessorTypesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function fetchProcessorTypes(FetchProcessorTypesRequest $request, array $callOptions = []): FetchProcessorTypesResponse - { - return $this->startApiCall('FetchProcessorTypes', $request, $callOptions)->wait(); - } - - /** - * Retrieves a specific evaluation. - * - * The async variant is {@see DocumentProcessorServiceClient::getEvaluationAsync()} - * . - * - * @example samples/V1/DocumentProcessorServiceClient/get_evaluation.php - * - * @param GetEvaluationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Evaluation - * - * @throws ApiException Thrown if the API call fails. - */ - public function getEvaluation(GetEvaluationRequest $request, array $callOptions = []): Evaluation - { - return $this->startApiCall('GetEvaluation', $request, $callOptions)->wait(); - } - - /** - * Gets a processor detail. - * - * The async variant is {@see DocumentProcessorServiceClient::getProcessorAsync()} - * . - * - * @example samples/V1/DocumentProcessorServiceClient/get_processor.php - * - * @param GetProcessorRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Processor - * - * @throws ApiException Thrown if the API call fails. - */ - public function getProcessor(GetProcessorRequest $request, array $callOptions = []): Processor - { - return $this->startApiCall('GetProcessor', $request, $callOptions)->wait(); - } - - /** - * Gets a processor type detail. - * - * The async variant is - * {@see DocumentProcessorServiceClient::getProcessorTypeAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/get_processor_type.php - * - * @param GetProcessorTypeRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ProcessorType - * - * @throws ApiException Thrown if the API call fails. - */ - public function getProcessorType(GetProcessorTypeRequest $request, array $callOptions = []): ProcessorType - { - return $this->startApiCall('GetProcessorType', $request, $callOptions)->wait(); - } - - /** - * Gets a processor version detail. - * - * The async variant is - * {@see DocumentProcessorServiceClient::getProcessorVersionAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/get_processor_version.php - * - * @param GetProcessorVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ProcessorVersion - * - * @throws ApiException Thrown if the API call fails. - */ - public function getProcessorVersion(GetProcessorVersionRequest $request, array $callOptions = []): ProcessorVersion - { - return $this->startApiCall('GetProcessorVersion', $request, $callOptions)->wait(); - } - - /** - * Retrieves a set of evaluations for a given processor version. - * - * The async variant is - * {@see DocumentProcessorServiceClient::listEvaluationsAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/list_evaluations.php - * - * @param ListEvaluationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listEvaluations(ListEvaluationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListEvaluations', $request, $callOptions); - } - - /** - * Lists the processor types that exist. - * - * The async variant is - * {@see DocumentProcessorServiceClient::listProcessorTypesAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/list_processor_types.php - * - * @param ListProcessorTypesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listProcessorTypes(ListProcessorTypesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListProcessorTypes', $request, $callOptions); - } - - /** - * Lists all versions of a processor. - * - * The async variant is - * {@see DocumentProcessorServiceClient::listProcessorVersionsAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/list_processor_versions.php - * - * @param ListProcessorVersionsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listProcessorVersions(ListProcessorVersionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListProcessorVersions', $request, $callOptions); - } - - /** - * Lists all processors which belong to this project. - * - * The async variant is - * {@see DocumentProcessorServiceClient::listProcessorsAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/list_processors.php - * - * @param ListProcessorsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listProcessors(ListProcessorsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListProcessors', $request, $callOptions); - } - - /** - * Processes a single document. - * - * The async variant is - * {@see DocumentProcessorServiceClient::processDocumentAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/process_document.php - * - * @param ProcessRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ProcessResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function processDocument(ProcessRequest $request, array $callOptions = []): ProcessResponse - { - return $this->startApiCall('ProcessDocument', $request, $callOptions)->wait(); - } - - /** - * Send a document for Human Review. The input document should be processed by - * the specified processor. - * - * The async variant is - * {@see DocumentProcessorServiceClient::reviewDocumentAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/review_document.php - * - * @param ReviewDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function reviewDocument(ReviewDocumentRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ReviewDocument', $request, $callOptions)->wait(); - } - - /** - * Set the default (active) version of a - * [Processor][google.cloud.documentai.v1.Processor] that will be used in - * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] - * and - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. - * - * The async variant is - * {@see DocumentProcessorServiceClient::setDefaultProcessorVersionAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/set_default_processor_version.php - * - * @param SetDefaultProcessorVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function setDefaultProcessorVersion(SetDefaultProcessorVersionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('SetDefaultProcessorVersion', $request, $callOptions)->wait(); - } - - /** - * Trains a new processor version. - * Operation metadata is returned as - * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. - * - * The async variant is - * {@see DocumentProcessorServiceClient::trainProcessorVersionAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/train_processor_version.php - * - * @param TrainProcessorVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function trainProcessorVersion(TrainProcessorVersionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('TrainProcessorVersion', $request, $callOptions)->wait(); - } - - /** - * Undeploys the processor version. - * - * The async variant is - * {@see DocumentProcessorServiceClient::undeployProcessorVersionAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/undeploy_processor_version.php - * - * @param UndeployProcessorVersionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function undeployProcessorVersion(UndeployProcessorVersionRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UndeployProcessorVersion', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see DocumentProcessorServiceClient::getLocationAsync()} . - * - * @example samples/V1/DocumentProcessorServiceClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see DocumentProcessorServiceClient::listLocationsAsync()} - * . - * - * @example samples/V1/DocumentProcessorServiceClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/DocumentProcessorServiceClient.php b/owl-bot-staging/DocumentAi/v1/src/V1/DocumentProcessorServiceClient.php deleted file mode 100644 index db75c66a1ce3..000000000000 --- a/owl-bot-staging/DocumentAi/v1/src/V1/DocumentProcessorServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -batchProcessDocuments($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->batchProcessDocuments($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'batchProcessDocuments'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\DocumentAI\V1\Client\DocumentProcessorServiceClient}. - */ -class DocumentProcessorServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.documentai.v1.DocumentProcessorService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'documentai.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'documentai.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $evaluationNameTemplate; - - private static $humanReviewConfigNameTemplate; - - private static $locationNameTemplate; - - private static $processorNameTemplate; - - private static $processorTypeNameTemplate; - - private static $processorVersionNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/document_processor_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/document_processor_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/document_processor_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/document_processor_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEvaluationNameTemplate() - { - if (self::$evaluationNameTemplate == null) { - self::$evaluationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}'); - } - - return self::$evaluationNameTemplate; - } - - private static function getHumanReviewConfigNameTemplate() - { - if (self::$humanReviewConfigNameTemplate == null) { - self::$humanReviewConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig'); - } - - return self::$humanReviewConfigNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProcessorNameTemplate() - { - if (self::$processorNameTemplate == null) { - self::$processorNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processors/{processor}'); - } - - return self::$processorNameTemplate; - } - - private static function getProcessorTypeNameTemplate() - { - if (self::$processorTypeNameTemplate == null) { - self::$processorTypeNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processorTypes/{processor_type}'); - } - - return self::$processorTypeNameTemplate; - } - - private static function getProcessorVersionNameTemplate() - { - if (self::$processorVersionNameTemplate == null) { - self::$processorVersionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}'); - } - - return self::$processorVersionNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'evaluation' => self::getEvaluationNameTemplate(), - 'humanReviewConfig' => self::getHumanReviewConfigNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'processor' => self::getProcessorNameTemplate(), - 'processorType' => self::getProcessorTypeNameTemplate(), - 'processorVersion' => self::getProcessorVersionNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a evaluation - * resource. - * - * @param string $project - * @param string $location - * @param string $processor - * @param string $processorVersion - * @param string $evaluation - * - * @return string The formatted evaluation resource. - */ - public static function evaluationName($project, $location, $processor, $processorVersion, $evaluation) - { - return self::getEvaluationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'processor' => $processor, - 'processor_version' => $processorVersion, - 'evaluation' => $evaluation, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * human_review_config resource. - * - * @param string $project - * @param string $location - * @param string $processor - * - * @return string The formatted human_review_config resource. - */ - public static function humanReviewConfigName($project, $location, $processor) - { - return self::getHumanReviewConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'processor' => $processor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a processor - * resource. - * - * @param string $project - * @param string $location - * @param string $processor - * - * @return string The formatted processor resource. - */ - public static function processorName($project, $location, $processor) - { - return self::getProcessorNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'processor' => $processor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * processor_type resource. - * - * @param string $project - * @param string $location - * @param string $processorType - * - * @return string The formatted processor_type resource. - */ - public static function processorTypeName($project, $location, $processorType) - { - return self::getProcessorTypeNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'processor_type' => $processorType, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * processor_version resource. - * - * @param string $project - * @param string $location - * @param string $processor - * @param string $processorVersion - * - * @return string The formatted processor_version resource. - */ - public static function processorVersionName($project, $location, $processor, $processorVersion) - { - return self::getProcessorVersionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'processor' => $processor, - 'processor_version' => $processorVersion, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - evaluation: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation} - * - humanReviewConfig: projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig - * - location: projects/{project}/locations/{location} - * - processor: projects/{project}/locations/{location}/processors/{processor} - * - processorType: projects/{project}/locations/{location}/processorTypes/{processor_type} - * - processorVersion: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'documentai.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * LRO endpoint to batch process many documents. The output is written - * to Cloud Storage as JSON in the [Document] format. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $name = 'name'; - * $operationResponse = $documentProcessorServiceClient->batchProcessDocuments($name); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->batchProcessDocuments($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'batchProcessDocuments'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param array $optionalArgs { - * Optional. - * - * @type BatchDocumentsInputConfig $inputDocuments - * The input documents for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * @type DocumentOutputConfig $documentOutputConfig - * The output configuration for the - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments] - * method. - * @type bool $skipHumanReview - * Whether human review should be skipped for this request. Default to - * `false`. - * @type ProcessOptions $processOptions - * Inference-time options for the process API - * @type array $labels - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchProcessDocuments($name, array $optionalArgs = []) - { - $request = new BatchProcessRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['inputDocuments'])) { - $request->setInputDocuments($optionalArgs['inputDocuments']); - } - - if (isset($optionalArgs['documentOutputConfig'])) { - $request->setDocumentOutputConfig($optionalArgs['documentOutputConfig']); - } - - if (isset($optionalArgs['skipHumanReview'])) { - $request->setSkipHumanReview($optionalArgs['skipHumanReview']); - } - - if (isset($optionalArgs['processOptions'])) { - $request->setProcessOptions($optionalArgs['processOptions']); - } - - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchProcessDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a processor from the - * [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The - * processor will be at `ENABLED` state by default after its creation. Note - * that this method requires the `documentai.processors.create` permission on - * the project, which is highly privileged. A user or service account with - * this permission can create new processors that can interact with any gcs - * bucket in your project. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedParent = $documentProcessorServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $processor = new Processor(); - * $response = $documentProcessorServiceClient->createProcessor($formattedParent, $processor); - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - * @param Processor $processor Required. The processor to be created, requires - * [Processor.type][google.cloud.documentai.v1.Processor.type] and - * [Processor.display_name][google.cloud.documentai.v1.Processor.display_name] - * to be set. Also, the - * [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name] - * field must be set if the processor is under CMEK. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DocumentAI\V1\Processor - * - * @throws ApiException if the remote call fails - */ - public function createProcessor($parent, $processor, array $optionalArgs = []) - { - $request = new CreateProcessorRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setProcessor($processor); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateProcessor', Processor::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the processor, unloads all deployed model artifacts if it was - * enabled and then deletes all artifacts associated with this processor. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - * $operationResponse = $documentProcessorServiceClient->deleteProcessor($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->deleteProcessor($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'deleteProcessor'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor resource name to be deleted. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteProcessor($name, array $optionalArgs = []) - { - $request = new DeleteProcessorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteProcessor', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes the processor version, all artifacts under the processor version - * will be deleted. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - * $operationResponse = $documentProcessorServiceClient->deleteProcessorVersion($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->deleteProcessorVersion($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'deleteProcessorVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor version resource name to be deleted. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteProcessorVersion($name, array $optionalArgs = []) - { - $request = new DeleteProcessorVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deploys the processor version. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - * $operationResponse = $documentProcessorServiceClient->deployProcessorVersion($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->deployProcessorVersion($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'deployProcessorVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor version resource name to be deployed. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deployProcessorVersion($name, array $optionalArgs = []) - { - $request = new DeployProcessorVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeployProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Disables a processor - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - * $operationResponse = $documentProcessorServiceClient->disableProcessor($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->disableProcessor($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'disableProcessor'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor resource name to be disabled. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function disableProcessor($name, array $optionalArgs = []) - { - $request = new DisableProcessorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DisableProcessor', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Enables a processor - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - * $operationResponse = $documentProcessorServiceClient->enableProcessor($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->enableProcessor($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'enableProcessor'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor resource name to be enabled. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function enableProcessor($name, array $optionalArgs = []) - { - $request = new EnableProcessorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('EnableProcessor', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Evaluates a ProcessorVersion against annotated documents, producing an - * Evaluation. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedProcessorVersion = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - * $operationResponse = $documentProcessorServiceClient->evaluateProcessorVersion($formattedProcessorVersion); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->evaluateProcessorVersion($formattedProcessorVersion); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'evaluateProcessorVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $processorVersion Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param array $optionalArgs { - * Optional. - * - * @type BatchDocumentsInputConfig $evaluationDocuments - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function evaluateProcessorVersion($processorVersion, array $optionalArgs = []) - { - $request = new EvaluateProcessorVersionRequest(); - $requestParamHeaders = []; - $request->setProcessorVersion($processorVersion); - $requestParamHeaders['processor_version'] = $processorVersion; - if (isset($optionalArgs['evaluationDocuments'])) { - $request->setEvaluationDocuments($optionalArgs['evaluationDocuments']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('EvaluateProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Fetches processor types. Note that we don't use - * [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] - * here, because it isn't paginated. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedParent = $documentProcessorServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $response = $documentProcessorServiceClient->fetchProcessorTypes($formattedParent); - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DocumentAI\V1\FetchProcessorTypesResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchProcessorTypes($parent, array $optionalArgs = []) - { - $request = new FetchProcessorTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('FetchProcessorTypes', FetchProcessorTypesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves a specific evaluation. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); - * $response = $documentProcessorServiceClient->getEvaluation($formattedName); - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [Evaluation][google.cloud.documentai.v1.Evaluation] to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DocumentAI\V1\Evaluation - * - * @throws ApiException if the remote call fails - */ - public function getEvaluation($name, array $optionalArgs = []) - { - $request = new GetEvaluationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetEvaluation', Evaluation::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a processor detail. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - * $response = $documentProcessorServiceClient->getProcessor($formattedName); - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor resource name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DocumentAI\V1\Processor - * - * @throws ApiException if the remote call fails - */ - public function getProcessor($name, array $optionalArgs = []) - { - $request = new GetProcessorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetProcessor', Processor::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a processor type detail. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); - * $response = $documentProcessorServiceClient->getProcessorType($formattedName); - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor type resource name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DocumentAI\V1\ProcessorType - * - * @throws ApiException if the remote call fails - */ - public function getProcessorType($name, array $optionalArgs = []) - { - $request = new GetProcessorTypeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetProcessorType', ProcessorType::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a processor version detail. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - * $response = $documentProcessorServiceClient->getProcessorVersion($formattedName); - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor resource name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DocumentAI\V1\ProcessorVersion - * - * @throws ApiException if the remote call fails - */ - public function getProcessorVersion($name, array $optionalArgs = []) - { - $request = new GetProcessorVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetProcessorVersion', ProcessorVersion::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieves a set of evaluations for a given processor version. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedParent = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - * // Iterate over pages of elements - * $pagedResponse = $documentProcessorServiceClient->listEvaluations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $documentProcessorServiceClient->listEvaluations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listEvaluations($parent, array $optionalArgs = []) - { - $request = new ListEvaluationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListEvaluations', $optionalArgs, ListEvaluationsResponse::class, $request); - } - - /** - * Lists the processor types that exist. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedParent = $documentProcessorServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $documentProcessorServiceClient->listProcessorTypes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $documentProcessorServiceClient->listProcessorTypes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listProcessorTypes($parent, array $optionalArgs = []) - { - $request = new ListProcessorTypesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListProcessorTypes', $optionalArgs, ListProcessorTypesResponse::class, $request); - } - - /** - * Lists all versions of a processor. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedParent = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - * // Iterate over pages of elements - * $pagedResponse = $documentProcessorServiceClient->listProcessorVersions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $documentProcessorServiceClient->listProcessorVersions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listProcessorVersions($parent, array $optionalArgs = []) - { - $request = new ListProcessorVersionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListProcessorVersions', $optionalArgs, ListProcessorVersionsResponse::class, $request); - } - - /** - * Lists all processors which belong to this project. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedParent = $documentProcessorServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $documentProcessorServiceClient->listProcessors($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $documentProcessorServiceClient->listProcessors($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listProcessors($parent, array $optionalArgs = []) - { - $request = new ListProcessorsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListProcessors', $optionalArgs, ListProcessorsResponse::class, $request); - } - - /** - * Processes a single document. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $name = 'name'; - * $response = $documentProcessorServiceClient->processDocument($name); - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] or - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - * to use for processing. If a - * [Processor][google.cloud.documentai.v1.Processor] is specified, the server - * will use its [default - * version][google.cloud.documentai.v1.Processor.default_processor_version]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param array $optionalArgs { - * Optional. - * - * @type Document $inlineDocument - * An inline document proto. - * @type RawDocument $rawDocument - * A raw document content (bytes). - * @type GcsDocument $gcsDocument - * A raw document on Google Cloud Storage. - * @type bool $skipHumanReview - * Whether human review should be skipped for this request. Default to - * `false`. - * @type FieldMask $fieldMask - * Specifies which fields to include in the - * [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document] - * output. Only supports top-level document and pages field, so it must be in - * the form of `{document_field_name}` or `pages.{page_field_name}`. - * @type ProcessOptions $processOptions - * Inference-time options for the process API - * @type array $labels - * Optional. The labels with user-defined metadata for the request. - * - * Label keys and values can be no longer than 63 characters - * (Unicode codepoints) and can only contain lowercase letters, numeric - * characters, underscores, and dashes. International characters are allowed. - * Label values are optional. Label keys must start with a letter. - * @type bool $imagelessMode - * Optional. Option to remove images from the document. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DocumentAI\V1\ProcessResponse - * - * @throws ApiException if the remote call fails - */ - public function processDocument($name, array $optionalArgs = []) - { - $request = new ProcessRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['inlineDocument'])) { - $request->setInlineDocument($optionalArgs['inlineDocument']); - } - - if (isset($optionalArgs['rawDocument'])) { - $request->setRawDocument($optionalArgs['rawDocument']); - } - - if (isset($optionalArgs['gcsDocument'])) { - $request->setGcsDocument($optionalArgs['gcsDocument']); - } - - if (isset($optionalArgs['skipHumanReview'])) { - $request->setSkipHumanReview($optionalArgs['skipHumanReview']); - } - - if (isset($optionalArgs['fieldMask'])) { - $request->setFieldMask($optionalArgs['fieldMask']); - } - - if (isset($optionalArgs['processOptions'])) { - $request->setProcessOptions($optionalArgs['processOptions']); - } - - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - if (isset($optionalArgs['imagelessMode'])) { - $request->setImagelessMode($optionalArgs['imagelessMode']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ProcessDocument', ProcessResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Send a document for Human Review. The input document should be processed by - * the specified processor. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedHumanReviewConfig = $documentProcessorServiceClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - * $operationResponse = $documentProcessorServiceClient->reviewDocument($formattedHumanReviewConfig); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->reviewDocument($formattedHumanReviewConfig); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'reviewDocument'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $humanReviewConfig Required. The resource name of the - * [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the - * document will be reviewed with. - * @param array $optionalArgs { - * Optional. - * - * @type Document $inlineDocument - * An inline document proto. - * @type bool $enableSchemaValidation - * Whether the validation should be performed on the ad-hoc review request. - * @type int $priority - * The priority of the human review task. - * For allowed values, use constants defined on {@see \Google\Cloud\DocumentAI\V1\ReviewDocumentRequest\Priority} - * @type DocumentSchema $documentSchema - * The document schema of the human review task. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function reviewDocument($humanReviewConfig, array $optionalArgs = []) - { - $request = new ReviewDocumentRequest(); - $requestParamHeaders = []; - $request->setHumanReviewConfig($humanReviewConfig); - $requestParamHeaders['human_review_config'] = $humanReviewConfig; - if (isset($optionalArgs['inlineDocument'])) { - $request->setInlineDocument($optionalArgs['inlineDocument']); - } - - if (isset($optionalArgs['enableSchemaValidation'])) { - $request->setEnableSchemaValidation($optionalArgs['enableSchemaValidation']); - } - - if (isset($optionalArgs['priority'])) { - $request->setPriority($optionalArgs['priority']); - } - - if (isset($optionalArgs['documentSchema'])) { - $request->setDocumentSchema($optionalArgs['documentSchema']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ReviewDocument', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Set the default (active) version of a - * [Processor][google.cloud.documentai.v1.Processor] that will be used in - * [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] - * and - * [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedProcessor = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - * $formattedDefaultProcessorVersion = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - * $operationResponse = $documentProcessorServiceClient->setDefaultProcessorVersion($formattedProcessor, $formattedDefaultProcessorVersion); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->setDefaultProcessorVersion($formattedProcessor, $formattedDefaultProcessorVersion); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'setDefaultProcessorVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $processor Required. The resource name of the - * [Processor][google.cloud.documentai.v1.Processor] to change default - * version. - * @param string $defaultProcessorVersion Required. The resource name of child - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as - * default. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function setDefaultProcessorVersion($processor, $defaultProcessorVersion, array $optionalArgs = []) - { - $request = new SetDefaultProcessorVersionRequest(); - $requestParamHeaders = []; - $request->setProcessor($processor); - $request->setDefaultProcessorVersion($defaultProcessorVersion); - $requestParamHeaders['processor'] = $processor; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('SetDefaultProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Trains a new processor version. - * Operation metadata is returned as - * [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata]. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedParent = $documentProcessorServiceClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - * $processorVersion = new ProcessorVersion(); - * $operationResponse = $documentProcessorServiceClient->trainProcessorVersion($formattedParent, $processorVersion); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->trainProcessorVersion($formattedParent, $processorVersion); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'trainProcessorVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - * @param ProcessorVersion $processorVersion Required. The processor version to be created. - * @param array $optionalArgs { - * Optional. - * - * @type CustomDocumentExtractionOptions $customDocumentExtractionOptions - * Options to control Custom Document Extraction (CDE) Processor. - * @type FoundationModelTuningOptions $foundationModelTuningOptions - * Options to control foundation model tuning of a processor. - * @type DocumentSchema $documentSchema - * Optional. The schema the processor version will be trained with. - * @type InputData $inputData - * Optional. The input data used to train the - * [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. - * @type string $baseProcessorVersion - * Optional. The processor version to use as a base for training. This - * processor version must be a child of `parent`. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function trainProcessorVersion($parent, $processorVersion, array $optionalArgs = []) - { - $request = new TrainProcessorVersionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setProcessorVersion($processorVersion); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['customDocumentExtractionOptions'])) { - $request->setCustomDocumentExtractionOptions($optionalArgs['customDocumentExtractionOptions']); - } - - if (isset($optionalArgs['foundationModelTuningOptions'])) { - $request->setFoundationModelTuningOptions($optionalArgs['foundationModelTuningOptions']); - } - - if (isset($optionalArgs['documentSchema'])) { - $request->setDocumentSchema($optionalArgs['documentSchema']); - } - - if (isset($optionalArgs['inputData'])) { - $request->setInputData($optionalArgs['inputData']); - } - - if (isset($optionalArgs['baseProcessorVersion'])) { - $request->setBaseProcessorVersion($optionalArgs['baseProcessorVersion']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('TrainProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Undeploys the processor version. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $formattedName = $documentProcessorServiceClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - * $operationResponse = $documentProcessorServiceClient->undeployProcessorVersion($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $documentProcessorServiceClient->undeployProcessorVersion($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $documentProcessorServiceClient->resumeOperation($operationName, 'undeployProcessorVersion'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The processor version resource name to be undeployed. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function undeployProcessorVersion($name, array $optionalArgs = []) - { - $request = new UndeployProcessorVersionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UndeployProcessorVersion', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * $response = $documentProcessorServiceClient->getLocation(); - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $documentProcessorServiceClient = new DocumentProcessorServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $documentProcessorServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $documentProcessorServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $documentProcessorServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DocumentAi/v1/src/V1/gapic_metadata.json deleted file mode 100644 index b6a28df90b49..000000000000 --- a/owl-bot-staging/DocumentAi/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.documentai.v1", - "libraryPackage": "Google\\Cloud\\DocumentAI\\V1", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "DocumentProcessorServiceGapicClient", - "rpcs": { - "BatchProcessDocuments": { - "methods": [ - "batchProcessDocuments" - ] - }, - "CreateProcessor": { - "methods": [ - "createProcessor" - ] - }, - "DeleteProcessor": { - "methods": [ - "deleteProcessor" - ] - }, - "DeleteProcessorVersion": { - "methods": [ - "deleteProcessorVersion" - ] - }, - "DeployProcessorVersion": { - "methods": [ - "deployProcessorVersion" - ] - }, - "DisableProcessor": { - "methods": [ - "disableProcessor" - ] - }, - "EnableProcessor": { - "methods": [ - "enableProcessor" - ] - }, - "EvaluateProcessorVersion": { - "methods": [ - "evaluateProcessorVersion" - ] - }, - "FetchProcessorTypes": { - "methods": [ - "fetchProcessorTypes" - ] - }, - "GetEvaluation": { - "methods": [ - "getEvaluation" - ] - }, - "GetProcessor": { - "methods": [ - "getProcessor" - ] - }, - "GetProcessorType": { - "methods": [ - "getProcessorType" - ] - }, - "GetProcessorVersion": { - "methods": [ - "getProcessorVersion" - ] - }, - "ListEvaluations": { - "methods": [ - "listEvaluations" - ] - }, - "ListProcessorTypes": { - "methods": [ - "listProcessorTypes" - ] - }, - "ListProcessorVersions": { - "methods": [ - "listProcessorVersions" - ] - }, - "ListProcessors": { - "methods": [ - "listProcessors" - ] - }, - "ProcessDocument": { - "methods": [ - "processDocument" - ] - }, - "ReviewDocument": { - "methods": [ - "reviewDocument" - ] - }, - "SetDefaultProcessorVersion": { - "methods": [ - "setDefaultProcessorVersion" - ] - }, - "TrainProcessorVersion": { - "methods": [ - "trainProcessorVersion" - ] - }, - "UndeployProcessorVersion": { - "methods": [ - "undeployProcessorVersion" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_client_config.json b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_client_config.json deleted file mode 100644 index 30f1e5961a04..000000000000 --- a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_client_config.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "interfaces": { - "google.cloud.documentai.v1.DocumentProcessorService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "retry_policy_2_codes": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 300000 - }, - "retry_policy_2_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 120000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 120000, - "total_timeout_millis": 120000 - } - }, - "methods": { - "BatchProcessDocuments": { - "timeout_millis": 120000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" - }, - "CreateProcessor": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteProcessor": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteProcessorVersion": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeployProcessorVersion": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DisableProcessor": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "EnableProcessor": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "EvaluateProcessorVersion": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "FetchProcessorTypes": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetEvaluation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetProcessor": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetProcessorType": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetProcessorVersion": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListEvaluations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListProcessorTypes": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListProcessorVersions": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListProcessors": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ProcessDocument": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ReviewDocument": { - "timeout_millis": 120000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" - }, - "SetDefaultProcessorVersion": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "TrainProcessorVersion": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UndeployProcessorVersion": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_descriptor_config.php b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_descriptor_config.php deleted file mode 100644 index 961e12f940bc..000000000000 --- a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_descriptor_config.php +++ /dev/null @@ -1,443 +0,0 @@ - [ - 'google.cloud.documentai.v1.DocumentProcessorService' => [ - 'BatchProcessDocuments' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\BatchProcessResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\BatchProcessMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteProcessor' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\DeleteProcessorMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteProcessorVersion' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\DeleteProcessorVersionMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeployProcessorVersion' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\DeployProcessorVersionResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\DeployProcessorVersionMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DisableProcessor' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\DisableProcessorResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\DisableProcessorMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'EnableProcessor' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\EnableProcessorResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\EnableProcessorMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'EvaluateProcessorVersion' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\EvaluateProcessorVersionResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\EvaluateProcessorVersionMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'processor_version', - 'fieldAccessors' => [ - 'getProcessorVersion', - ], - ], - ], - ], - 'ReviewDocument' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\ReviewDocumentResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\ReviewDocumentOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'human_review_config', - 'fieldAccessors' => [ - 'getHumanReviewConfig', - ], - ], - ], - ], - 'SetDefaultProcessorVersion' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\SetDefaultProcessorVersionResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\SetDefaultProcessorVersionMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'processor', - 'fieldAccessors' => [ - 'getProcessor', - ], - ], - ], - ], - 'TrainProcessorVersion' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\TrainProcessorVersionResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\TrainProcessorVersionMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UndeployProcessorVersion' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\DocumentAI\V1\UndeployProcessorVersionResponse', - 'metadataReturnType' => '\Google\Cloud\DocumentAI\V1\UndeployProcessorVersionMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateProcessor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\Processor', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'FetchProcessorTypes' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\FetchProcessorTypesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetEvaluation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\Evaluation', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetProcessor' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\Processor', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetProcessorType' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\ProcessorType', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetProcessorVersion' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\ProcessorVersion', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListEvaluations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getEvaluations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\ListEvaluationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListProcessorTypes' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProcessorTypes', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\ListProcessorTypesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListProcessorVersions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProcessorVersions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\ListProcessorVersionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListProcessors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProcessors', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\ListProcessorsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ProcessDocument' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DocumentAI\V1\ProcessResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'evaluation' => 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}', - 'humanReviewConfig' => 'projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig', - 'location' => 'projects/{project}/locations/{location}', - 'processor' => 'projects/{project}/locations/{location}/processors/{processor}', - 'processorType' => 'projects/{project}/locations/{location}/processorTypes/{processor_type}', - 'processorVersion' => 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}', - ], - ], - ], -]; diff --git a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_rest_client_config.php b/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_rest_client_config.php deleted file mode 100644 index 7634fa638b42..000000000000 --- a/owl-bot-staging/DocumentAi/v1/src/V1/resources/document_processor_service_rest_client_config.php +++ /dev/null @@ -1,389 +0,0 @@ - [ - 'google.cloud.documentai.v1.DocumentProcessorService' => [ - 'BatchProcessDocuments' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}:batchProcess', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateProcessor' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processors', - 'body' => 'processor', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteProcessor' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteProcessorVersion' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeployProcessorVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DisableProcessor' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}:disable', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'EnableProcessor' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}:enable', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'EvaluateProcessorVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion', - 'body' => '*', - 'placeholders' => [ - 'processor_version' => [ - 'getters' => [ - 'getProcessorVersion', - ], - ], - ], - ], - 'FetchProcessorTypes' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:fetchProcessorTypes', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetEvaluation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetProcessor' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetProcessorType' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processorTypes/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetProcessorVersion' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListEvaluations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListProcessorTypes' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processorTypes', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListProcessorVersions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processors/*}/processorVersions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListProcessors' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processors', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ProcessDocument' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*}:process', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ReviewDocument' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument', - 'body' => '*', - 'placeholders' => [ - 'human_review_config' => [ - 'getters' => [ - 'getHumanReviewConfig', - ], - ], - ], - ], - 'SetDefaultProcessorVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion', - 'body' => '*', - 'placeholders' => [ - 'processor' => [ - 'getters' => [ - 'getProcessor', - ], - ], - ], - ], - 'TrainProcessorVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UndeployProcessorVersion' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/uiv1beta3/{name=projects/*/locations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/uiv1beta3/{name=projects/*}/locations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/uiv1beta3/{name=projects/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/uiv1beta3/{name=projects/*/locations/*/operations}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php b/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php deleted file mode 100644 index 646e60720ba9..000000000000 --- a/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/Client/DocumentProcessorServiceClientTest.php +++ /dev/null @@ -1,2437 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DocumentProcessorServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DocumentProcessorServiceClient($options); - } - - /** @test */ - public function batchProcessDocumentsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchProcessDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchProcessResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchProcessDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $request = (new BatchProcessRequest()) - ->setName($name); - $response = $gapicClient->batchProcessDocuments($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchProcessDocumentsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchProcessDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new BatchProcessRequest()) - ->setName($name); - $response = $gapicClient->batchProcessDocuments($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createProcessorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $type = 'type3575610'; - $displayName = 'displayName1615086568'; - $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; - $processEndpoint = 'processEndpoint-178717339'; - $kmsKeyName = 'kmsKeyName2094986649'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new Processor(); - $expectedResponse->setName($name); - $expectedResponse->setType($type); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); - $expectedResponse->setProcessEndpoint($processEndpoint); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $processor = new Processor(); - $request = (new CreateProcessorRequest()) - ->setParent($formattedParent) - ->setProcessor($processor); - $response = $gapicClient->createProcessor($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/CreateProcessor', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getProcessor(); - $this->assertProtobufEquals($processor, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createProcessorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $processor = new Processor(); - $request = (new CreateProcessorRequest()) - ->setParent($formattedParent) - ->setProcessor($processor); - try { - $gapicClient->createProcessor($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteProcessorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteProcessorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new DeleteProcessorRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteProcessor($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessor', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteProcessorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new DeleteProcessorRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteProcessor($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new DeleteProcessorVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new DeleteProcessorVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new DeployProcessorVersionResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deployProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new DeployProcessorVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->deployProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeployProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new DeployProcessorVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->deployProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function disableProcessorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/disableProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new DisableProcessorResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/disableProcessorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new DisableProcessorRequest()) - ->setName($formattedName); - $response = $gapicClient->disableProcessor($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DisableProcessor', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/disableProcessorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function disableProcessorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/disableProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new DisableProcessorRequest()) - ->setName($formattedName); - $response = $gapicClient->disableProcessor($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/disableProcessorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function enableProcessorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/enableProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new EnableProcessorResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/enableProcessorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new EnableProcessorRequest()) - ->setName($formattedName); - $response = $gapicClient->enableProcessor($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/EnableProcessor', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/enableProcessorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function enableProcessorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/enableProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new EnableProcessorRequest()) - ->setName($formattedName); - $response = $gapicClient->enableProcessor($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/enableProcessorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function evaluateProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/evaluateProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $evaluation = 'evaluation858523452'; - $expectedResponse = new EvaluateProcessorVersionResponse(); - $expectedResponse->setEvaluation($evaluation); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/evaluateProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new EvaluateProcessorVersionRequest()) - ->setProcessorVersion($formattedProcessorVersion); - $response = $gapicClient->evaluateProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/EvaluateProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProcessorVersion(); - $this->assertProtobufEquals($formattedProcessorVersion, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/evaluateProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function evaluateProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/evaluateProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new EvaluateProcessorVersionRequest()) - ->setProcessorVersion($formattedProcessorVersion); - $response = $gapicClient->evaluateProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/evaluateProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function fetchProcessorTypesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchProcessorTypesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new FetchProcessorTypesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->fetchProcessorTypes($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/FetchProcessorTypes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchProcessorTypesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new FetchProcessorTypesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->fetchProcessorTypes($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEvaluationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKeyName = 'kmsKeyName2094986649'; - $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; - $expectedResponse = new Evaluation(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); - $request = (new GetEvaluationRequest()) - ->setName($formattedName); - $response = $gapicClient->getEvaluation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetEvaluation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEvaluationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); - $request = (new GetEvaluationRequest()) - ->setName($formattedName); - try { - $gapicClient->getEvaluation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $displayName = 'displayName1615086568'; - $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; - $processEndpoint = 'processEndpoint-178717339'; - $kmsKeyName = 'kmsKeyName2094986649'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new Processor(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); - $expectedResponse->setProcessEndpoint($processEndpoint); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new GetProcessorRequest()) - ->setName($formattedName); - $response = $gapicClient->getProcessor($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new GetProcessorRequest()) - ->setName($formattedName); - try { - $gapicClient->getProcessor($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorTypeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $category = 'category50511102'; - $allowCreation = false; - $expectedResponse = new ProcessorType(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setCategory($category); - $expectedResponse->setAllowCreation($allowCreation); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); - $request = (new GetProcessorTypeRequest()) - ->setName($formattedName); - $response = $gapicClient->getProcessorType($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessorType', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorTypeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); - $request = (new GetProcessorTypeRequest()) - ->setName($formattedName); - try { - $gapicClient->getProcessorType($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $kmsKeyName = 'kmsKeyName2094986649'; - $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; - $googleManaged = false; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new ProcessorVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); - $expectedResponse->setGoogleManaged($googleManaged); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new GetProcessorVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->getProcessorVersion($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessorVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorVersionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new GetProcessorVersionRequest()) - ->setName($formattedName); - try { - $gapicClient->getProcessorVersion($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEvaluationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $evaluationsElement = new Evaluation(); - $evaluations = [ - $evaluationsElement, - ]; - $expectedResponse = new ListEvaluationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEvaluations($evaluations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new ListEvaluationsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listEvaluations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEvaluations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListEvaluations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEvaluationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new ListEvaluationsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listEvaluations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorTypesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processorTypesElement = new ProcessorType(); - $processorTypes = [ - $processorTypesElement, - ]; - $expectedResponse = new ListProcessorTypesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessorTypes($processorTypes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListProcessorTypesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listProcessorTypes($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessorTypes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessorTypes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorTypesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListProcessorTypesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listProcessorTypes($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processorVersionsElement = new ProcessorVersion(); - $processorVersions = [ - $processorVersionsElement, - ]; - $expectedResponse = new ListProcessorVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessorVersions($processorVersions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new ListProcessorVersionsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listProcessorVersions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessorVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessorVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorVersionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new ListProcessorVersionsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listProcessorVersions($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processorsElement = new Processor(); - $processors = [ - $processorsElement, - ]; - $expectedResponse = new ListProcessorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessors($processors); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListProcessorsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listProcessors($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessors', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListProcessorsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listProcessors($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function processDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ProcessResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $request = (new ProcessRequest()) - ->setName($name); - $response = $gapicClient->processDocument($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ProcessDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function processDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new ProcessRequest()) - ->setName($name); - try { - $gapicClient->processDocument($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function reviewDocumentTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/reviewDocumentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $gcsDestination = 'gcsDestination714819302'; - $rejectionReason = 'rejectionReason2141394746'; - $expectedResponse = new ReviewDocumentResponse(); - $expectedResponse->setGcsDestination($gcsDestination); - $expectedResponse->setRejectionReason($rejectionReason); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/reviewDocumentTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedHumanReviewConfig = $gapicClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new ReviewDocumentRequest()) - ->setHumanReviewConfig($formattedHumanReviewConfig); - $response = $gapicClient->reviewDocument($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ReviewDocument', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getHumanReviewConfig(); - $this->assertProtobufEquals($formattedHumanReviewConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/reviewDocumentTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function reviewDocumentExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/reviewDocumentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedHumanReviewConfig = $gapicClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $request = (new ReviewDocumentRequest()) - ->setHumanReviewConfig($formattedHumanReviewConfig); - $response = $gapicClient->reviewDocument($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/reviewDocumentTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setDefaultProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setDefaultProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SetDefaultProcessorVersionResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/setDefaultProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProcessor = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $formattedDefaultProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new SetDefaultProcessorVersionRequest()) - ->setProcessor($formattedProcessor) - ->setDefaultProcessorVersion($formattedDefaultProcessorVersion); - $response = $gapicClient->setDefaultProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/SetDefaultProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProcessor(); - $this->assertProtobufEquals($formattedProcessor, $actualValue); - $actualValue = $actualApiRequestObject->getDefaultProcessorVersion(); - $this->assertProtobufEquals($formattedDefaultProcessorVersion, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setDefaultProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setDefaultProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setDefaultProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedProcessor = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $formattedDefaultProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new SetDefaultProcessorVersionRequest()) - ->setProcessor($formattedProcessor) - ->setDefaultProcessorVersion($formattedDefaultProcessorVersion); - $response = $gapicClient->setDefaultProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setDefaultProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function trainProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/trainProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $processorVersion2 = 'processorVersion2-1092580578'; - $expectedResponse = new TrainProcessorVersionResponse(); - $expectedResponse->setProcessorVersion($processorVersion2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/trainProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $processorVersion = new ProcessorVersion(); - $request = (new TrainProcessorVersionRequest()) - ->setParent($formattedParent) - ->setProcessorVersion($processorVersion); - $response = $gapicClient->trainProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/TrainProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getProcessorVersion(); - $this->assertProtobufEquals($processorVersion, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/trainProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function trainProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/trainProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $processorVersion = new ProcessorVersion(); - $request = (new TrainProcessorVersionRequest()) - ->setParent($formattedParent) - ->setProcessorVersion($processorVersion); - $response = $gapicClient->trainProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/trainProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new UndeployProcessorVersionResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeployProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new UndeployProcessorVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->undeployProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/UndeployProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $request = (new UndeployProcessorVersionRequest()) - ->setName($formattedName); - $response = $gapicClient->undeployProcessorVersion($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchProcessDocumentsAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchProcessDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchProcessResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchProcessDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $request = (new BatchProcessRequest()) - ->setName($name); - $response = $gapicClient->batchProcessDocumentsAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/DocumentProcessorServiceClientTest.php b/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/DocumentProcessorServiceClientTest.php deleted file mode 100644 index 5498508ef1ef..000000000000 --- a/owl-bot-staging/DocumentAi/v1/tests/Unit/V1/DocumentProcessorServiceClientTest.php +++ /dev/null @@ -1,2251 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DocumentProcessorServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DocumentProcessorServiceClient($options); - } - - /** @test */ - public function batchProcessDocumentsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchProcessDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchProcessResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchProcessDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->batchProcessDocuments($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/BatchProcessDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function batchProcessDocumentsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/batchProcessDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->batchProcessDocuments($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchProcessDocumentsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createProcessorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $type = 'type3575610'; - $displayName = 'displayName1615086568'; - $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; - $processEndpoint = 'processEndpoint-178717339'; - $kmsKeyName = 'kmsKeyName2094986649'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new Processor(); - $expectedResponse->setName($name); - $expectedResponse->setType($type); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); - $expectedResponse->setProcessEndpoint($processEndpoint); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $processor = new Processor(); - $response = $gapicClient->createProcessor($formattedParent, $processor); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/CreateProcessor', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getProcessor(); - $this->assertProtobufEquals($processor, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createProcessorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $processor = new Processor(); - try { - $gapicClient->createProcessor($formattedParent, $processor); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteProcessorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteProcessorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->deleteProcessor($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessor', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteProcessorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->deleteProcessor($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->deleteProcessorVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeleteProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->deleteProcessorVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new DeployProcessorVersionResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deployProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->deployProcessorVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DeployProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deployProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deployProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->deployProcessorVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deployProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function disableProcessorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/disableProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new DisableProcessorResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/disableProcessorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->disableProcessor($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/DisableProcessor', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/disableProcessorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function disableProcessorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/disableProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->disableProcessor($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/disableProcessorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function enableProcessorTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/enableProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new EnableProcessorResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/enableProcessorTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->enableProcessor($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/EnableProcessor', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/enableProcessorTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function enableProcessorExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/enableProcessorTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->enableProcessor($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/enableProcessorTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function evaluateProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/evaluateProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $evaluation = 'evaluation858523452'; - $expectedResponse = new EvaluateProcessorVersionResponse(); - $expectedResponse->setEvaluation($evaluation); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/evaluateProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->evaluateProcessorVersion($formattedProcessorVersion); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/EvaluateProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProcessorVersion(); - $this->assertProtobufEquals($formattedProcessorVersion, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/evaluateProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function evaluateProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/evaluateProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->evaluateProcessorVersion($formattedProcessorVersion); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/evaluateProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function fetchProcessorTypesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchProcessorTypesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->fetchProcessorTypes($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/FetchProcessorTypes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchProcessorTypesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->fetchProcessorTypes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEvaluationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $kmsKeyName = 'kmsKeyName2094986649'; - $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; - $expectedResponse = new Evaluation(); - $expectedResponse->setName($name2); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); - $response = $gapicClient->getEvaluation($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetEvaluation', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getEvaluationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->evaluationName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]', '[EVALUATION]'); - try { - $gapicClient->getEvaluation($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $displayName = 'displayName1615086568'; - $defaultProcessorVersion = 'defaultProcessorVersion1185902509'; - $processEndpoint = 'processEndpoint-178717339'; - $kmsKeyName = 'kmsKeyName2094986649'; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new Processor(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDefaultProcessorVersion($defaultProcessorVersion); - $expectedResponse->setProcessEndpoint($processEndpoint); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->getProcessor($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - try { - $gapicClient->getProcessor($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorTypeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $category = 'category50511102'; - $allowCreation = false; - $expectedResponse = new ProcessorType(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setCategory($category); - $expectedResponse->setAllowCreation($allowCreation); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); - $response = $gapicClient->getProcessorType($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessorType', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorTypeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorTypeName('[PROJECT]', '[LOCATION]', '[PROCESSOR_TYPE]'); - try { - $gapicClient->getProcessorType($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorVersionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $kmsKeyName = 'kmsKeyName2094986649'; - $kmsKeyVersionName = 'kmsKeyVersionName-1734350176'; - $googleManaged = false; - $satisfiesPzs = false; - $satisfiesPzi = false; - $expectedResponse = new ProcessorVersion(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setKmsKeyName($kmsKeyName); - $expectedResponse->setKmsKeyVersionName($kmsKeyVersionName); - $expectedResponse->setGoogleManaged($googleManaged); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->getProcessorVersion($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/GetProcessorVersion', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessorVersionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - try { - $gapicClient->getProcessorVersion($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEvaluationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $evaluationsElement = new Evaluation(); - $evaluations = [ - $evaluationsElement, - ]; - $expectedResponse = new ListEvaluationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setEvaluations($evaluations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->listEvaluations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getEvaluations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListEvaluations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listEvaluationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - try { - $gapicClient->listEvaluations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorTypesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processorTypesElement = new ProcessorType(); - $processorTypes = [ - $processorTypesElement, - ]; - $expectedResponse = new ListProcessorTypesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessorTypes($processorTypes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listProcessorTypes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessorTypes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessorTypes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorTypesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listProcessorTypes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorVersionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processorVersionsElement = new ProcessorVersion(); - $processorVersions = [ - $processorVersionsElement, - ]; - $expectedResponse = new ListProcessorVersionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessorVersions($processorVersions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->listProcessorVersions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessorVersions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessorVersions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorVersionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - try { - $gapicClient->listProcessorVersions($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processorsElement = new Processor(); - $processors = [ - $processorsElement, - ]; - $expectedResponse = new ListProcessorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessors($processors); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listProcessors($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ListProcessors', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessorsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listProcessors($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function processDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ProcessResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->processDocument($name); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ProcessDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function processDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->processDocument($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function reviewDocumentTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/reviewDocumentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $gcsDestination = 'gcsDestination714819302'; - $rejectionReason = 'rejectionReason2141394746'; - $expectedResponse = new ReviewDocumentResponse(); - $expectedResponse->setGcsDestination($gcsDestination); - $expectedResponse->setRejectionReason($rejectionReason); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/reviewDocumentTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedHumanReviewConfig = $gapicClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->reviewDocument($formattedHumanReviewConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/ReviewDocument', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getHumanReviewConfig(); - $this->assertProtobufEquals($formattedHumanReviewConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/reviewDocumentTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function reviewDocumentExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/reviewDocumentTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedHumanReviewConfig = $gapicClient->humanReviewConfigName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $response = $gapicClient->reviewDocument($formattedHumanReviewConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/reviewDocumentTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setDefaultProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setDefaultProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new SetDefaultProcessorVersionResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/setDefaultProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedProcessor = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $formattedDefaultProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->setDefaultProcessorVersion($formattedProcessor, $formattedDefaultProcessorVersion); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/SetDefaultProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProcessor(); - $this->assertProtobufEquals($formattedProcessor, $actualValue); - $actualValue = $actualApiRequestObject->getDefaultProcessorVersion(); - $this->assertProtobufEquals($formattedDefaultProcessorVersion, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setDefaultProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function setDefaultProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/setDefaultProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedProcessor = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $formattedDefaultProcessorVersion = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->setDefaultProcessorVersion($formattedProcessor, $formattedDefaultProcessorVersion); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/setDefaultProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function trainProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/trainProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $processorVersion2 = 'processorVersion2-1092580578'; - $expectedResponse = new TrainProcessorVersionResponse(); - $expectedResponse->setProcessorVersion($processorVersion2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/trainProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $processorVersion = new ProcessorVersion(); - $response = $gapicClient->trainProcessorVersion($formattedParent, $processorVersion); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/TrainProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getProcessorVersion(); - $this->assertProtobufEquals($processorVersion, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/trainProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function trainProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/trainProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processorName('[PROJECT]', '[LOCATION]', '[PROCESSOR]'); - $processorVersion = new ProcessorVersion(); - $response = $gapicClient->trainProcessorVersion($formattedParent, $processorVersion); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/trainProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployProcessorVersionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new UndeployProcessorVersionResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/undeployProcessorVersionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->undeployProcessorVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.documentai.v1.DocumentProcessorService/UndeployProcessorVersion', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployProcessorVersionTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function undeployProcessorVersionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/undeployProcessorVersionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processorVersionName('[PROJECT]', '[LOCATION]', '[PROCESSOR]', '[PROCESSOR_VERSION]'); - $response = $gapicClient->undeployProcessorVersion($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/undeployProcessorVersionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}