From 4b22f2447bdda5ec517484b4462445fe5a954add Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 5 Dec 2024 23:06:24 +0000 Subject: [PATCH] docs: Update io.proto to use markdown headings instead of HTML, remove some unused HTML from markdown PiperOrigin-RevId: 703192272 Source-Link: https://github.com/googleapis/googleapis/commit/05347e0a68ac16ec35146249d598fcdc6dd8c0c5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/71b95495d6fb29d970ead6a17752d58d1efc8ffb Copy-Tag: eyJwIjoiQXV0b01sLy5Pd2xCb3QueWFtbCIsImgiOiI3MWI5NTQ5NWQ2ZmIyOWQ5NzBlYWQ2YTE3NzUyZDU4ZDFlZmM4ZmZiIn0= --- .../Cloud/Automl/V1/AnnotationPayload.php | Bin 0 -> 1802 bytes .../Google/Cloud/Automl/V1/AnnotationSpec.php | 33 + .../Google/Cloud/Automl/V1/Classification.php | Bin 0 -> 1852 bytes .../Google/Cloud/Automl/V1/DataItems.php | Bin 0 -> 2352 bytes .../Google/Cloud/Automl/V1/Dataset.php | Bin 0 -> 2227 bytes .../Google/Cloud/Automl/V1/Detection.php | 44 + .../Google/Cloud/Automl/V1/Geometry.php | 32 + .../Google/Cloud/Automl/V1/Image.php | 58 + .../GPBMetadata/Google/Cloud/Automl/V1/Io.php | Bin 0 -> 1759 bytes .../Google/Cloud/Automl/V1/Model.php | Bin 0 -> 2364 bytes .../Cloud/Automl/V1/ModelEvaluation.php | Bin 0 -> 2351 bytes .../Google/Cloud/Automl/V1/Operations.php | Bin 0 -> 2846 bytes .../Cloud/Automl/V1/PredictionService.php | 68 + .../Google/Cloud/Automl/V1/Service.php | Bin 0 -> 8219 bytes .../Google/Cloud/Automl/V1/Text.php | 37 + .../Google/Cloud/Automl/V1/TextExtraction.php | Bin 0 -> 1263 bytes .../Google/Cloud/Automl/V1/TextSegment.php | 32 + .../Google/Cloud/Automl/V1/TextSentiment.php | 39 + .../Google/Cloud/Automl/V1/Translation.php | 43 + .../Cloud/AutoMl/V1/AnnotationPayload.php | 303 +++ .../Google/Cloud/AutoMl/V1/AnnotationSpec.php | 151 ++ .../AutoMl/V1/BatchPredictInputConfig.php | 271 +++ .../V1/BatchPredictOperationMetadata.php | 125 ++ .../BatchPredictOutputInfo.php | 83 + .../AutoMl/V1/BatchPredictOutputConfig.php | 311 +++ .../Cloud/AutoMl/V1/BatchPredictRequest.php | 553 +++++ .../Cloud/AutoMl/V1/BatchPredictResult.php | 93 + .../AutoMl/V1/BoundingBoxMetricsEntry.php | 148 ++ .../ConfidenceMetricsEntry.php | 172 ++ .../Google/Cloud/AutoMl/V1/BoundingPoly.php | 69 + .../AutoMl/V1/ClassificationAnnotation.php | 83 + .../V1/ClassificationEvaluationMetrics.php | 293 +++ .../ConfidenceMetricsEntry.php | 568 +++++ .../ConfusionMatrix.php | 186 ++ .../ConfusionMatrix/Row.php | 82 + .../Cloud/AutoMl/V1/ClassificationType.php | 61 + .../V1/CreateDatasetOperationMetadata.php | 33 + .../Cloud/AutoMl/V1/CreateDatasetRequest.php | 127 ++ .../V1/CreateModelOperationMetadata.php | 33 + .../Cloud/AutoMl/V1/CreateModelRequest.php | 127 ++ .../src/Google/Cloud/AutoMl/V1/Dataset.php | 533 +++++ .../Cloud/AutoMl/V1/DeleteDatasetRequest.php | 81 + .../Cloud/AutoMl/V1/DeleteModelRequest.php | 81 + .../AutoMl/V1/DeleteOperationMetadata.php | 33 + .../V1/DeployModelOperationMetadata.php | 33 + .../Cloud/AutoMl/V1/DeployModelRequest.php | 156 ++ .../src/Google/Cloud/AutoMl/V1/Document.php | 237 ++ .../Cloud/AutoMl/V1/Document/Layout.php | 228 ++ .../V1/Document/Layout/TextSegmentType.php | 123 + .../Cloud/AutoMl/V1/DocumentDimensions.php | 135 ++ .../DocumentDimensionUnit.php | 71 + .../Cloud/AutoMl/V1/DocumentInputConfig.php | 89 + .../Google/Cloud/AutoMl/V1/ExamplePayload.php | 141 ++ .../AutoMl/V1/ExportDataOperationMetadata.php | 77 + .../ExportDataOutputInfo.php | 83 + .../Cloud/AutoMl/V1/ExportDataRequest.php | 127 ++ .../V1/ExportModelOperationMetadata.php | 81 + .../ExportModelOutputInfo.php | 76 + .../Cloud/AutoMl/V1/ExportModelRequest.php | 129 ++ .../Google/Cloud/AutoMl/V1/GcsDestination.php | 87 + .../src/Google/Cloud/AutoMl/V1/GcsSource.php | 75 + .../AutoMl/V1/GetAnnotationSpecRequest.php | 81 + .../Cloud/AutoMl/V1/GetDatasetRequest.php | 81 + .../AutoMl/V1/GetModelEvaluationRequest.php | 81 + .../Cloud/AutoMl/V1/GetModelRequest.php | 81 + .../src/Google/Cloud/AutoMl/V1/Image.php | 116 + .../V1/ImageClassificationDatasetMetadata.php | 67 + ...eClassificationModelDeploymentMetadata.php | 83 + .../V1/ImageClassificationModelMetadata.php | 491 ++++ .../V1/ImageObjectDetectionAnnotation.php | 115 + .../ImageObjectDetectionDatasetMetadata.php | 33 + .../ImageObjectDetectionEvaluationMetrics.php | 156 ++ ...ObjectDetectionModelDeploymentMetadata.php | 83 + .../V1/ImageObjectDetectionModelMetadata.php | 405 ++++ .../AutoMl/V1/ImportDataOperationMetadata.php | 33 + .../Cloud/AutoMl/V1/ImportDataRequest.php | 137 ++ .../Google/Cloud/AutoMl/V1/InputConfig.php | 614 +++++ .../Cloud/AutoMl/V1/ListDatasetsRequest.php | 215 ++ .../Cloud/AutoMl/V1/ListDatasetsResponse.php | 105 + .../AutoMl/V1/ListModelEvaluationsRequest.php | 245 ++ .../V1/ListModelEvaluationsResponse.php | 109 + .../Cloud/AutoMl/V1/ListModelsRequest.php | 219 ++ .../Cloud/AutoMl/V1/ListModelsResponse.php | 105 + .../src/Google/Cloud/AutoMl/V1/Model.php | 580 +++++ .../Cloud/AutoMl/V1/Model/DeploymentState.php | 64 + .../Cloud/AutoMl/V1/ModelEvaluation.php | 496 +++++ .../AutoMl/V1/ModelExportOutputConfig.php | 291 +++ .../Cloud/AutoMl/V1/NormalizedVertex.php | 105 + .../Cloud/AutoMl/V1/OperationMetadata.php | 511 +++++ .../Google/Cloud/AutoMl/V1/OutputConfig.php | 119 + .../Google/Cloud/AutoMl/V1/PredictRequest.php | 285 +++ .../Cloud/AutoMl/V1/PredictResponse.php | 229 ++ .../V1/TextClassificationDatasetMetadata.php | 67 + .../V1/TextClassificationModelMetadata.php | 67 + .../AutoMl/V1/TextExtractionAnnotation.php | 116 + .../V1/TextExtractionDatasetMetadata.php | 33 + .../V1/TextExtractionEvaluationMetrics.php | 105 + .../ConfidenceMetricsEntry.php | 180 ++ .../AutoMl/V1/TextExtractionModelMetadata.php | 33 + .../Google/Cloud/AutoMl/V1/TextSegment.php | 147 ++ .../AutoMl/V1/TextSentimentAnnotation.php | 111 + .../V1/TextSentimentDatasetMetadata.php | 87 + .../V1/TextSentimentEvaluationMetrics.php | 339 +++ .../AutoMl/V1/TextSentimentModelMetadata.php | 33 + .../Google/Cloud/AutoMl/V1/TextSnippet.php | 147 ++ .../Cloud/AutoMl/V1/TranslationAnnotation.php | 77 + .../AutoMl/V1/TranslationDatasetMetadata.php | 101 + .../V1/TranslationEvaluationMetrics.php | 101 + .../AutoMl/V1/TranslationModelMetadata.php | 155 ++ .../V1/UndeployModelOperationMetadata.php | 33 + .../Cloud/AutoMl/V1/UndeployModelRequest.php | 81 + .../Cloud/AutoMl/V1/UpdateDatasetRequest.php | 136 ++ .../Cloud/AutoMl/V1/UpdateModelRequest.php | 136 ++ .../V1/AutoMlClient/create_dataset.php | 85 + .../samples/V1/AutoMlClient/create_model.php | 89 + .../V1/AutoMlClient/delete_dataset.php | 84 + .../samples/V1/AutoMlClient/delete_model.php | 84 + .../samples/V1/AutoMlClient/deploy_model.php | 90 + .../samples/V1/AutoMlClient/export_data.php | 98 + .../samples/V1/AutoMlClient/export_model.php | 102 + .../V1/AutoMlClient/get_annotation_spec.php | 76 + .../samples/V1/AutoMlClient/get_dataset.php | 71 + .../v1/samples/V1/AutoMlClient/get_model.php | 71 + .../V1/AutoMlClient/get_model_evaluation.php | 76 + .../samples/V1/AutoMlClient/import_data.php | 92 + .../samples/V1/AutoMlClient/list_datasets.php | 76 + .../AutoMlClient/list_model_evaluations.php | 91 + .../samples/V1/AutoMlClient/list_models.php | 76 + .../V1/AutoMlClient/undeploy_model.php | 86 + .../V1/AutoMlClient/update_dataset.php | 62 + .../samples/V1/AutoMlClient/update_model.php | 62 + .../PredictionServiceClient/batch_predict.php | 130 ++ .../V1/PredictionServiceClient/predict.php | 109 + .../AutoMl/v1/src/V1/Client/AutoMlClient.php | 912 ++++++++ .../src/V1/Client/PredictionServiceClient.php | 374 ++++ .../AutoMl/v1/src/V1/gapic_metadata.json | 127 ++ .../V1/resources/auto_ml_client_config.json | 135 ++ .../resources/auto_ml_descriptor_config.php | 340 +++ .../resources/auto_ml_rest_client_config.php | 389 ++++ .../prediction_service_client_config.json | 42 + .../prediction_service_descriptor_config.php | 62 + .../prediction_service_rest_client_config.php | 195 ++ .../tests/Unit/V1/Client/AutoMlClientTest.php | 1982 +++++++++++++++++ .../V1/Client/PredictionServiceClientTest.php | 370 +++ 144 files changed, 22192 insertions(+) create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationPayload.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationSpec.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Classification.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/DataItems.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Dataset.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Detection.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Geometry.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Image.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Io.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Model.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/ModelEvaluation.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Operations.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/PredictionService.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Service.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Text.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextExtraction.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSegment.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSentiment.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Translation.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationPayload.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationSpec.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictInputConfig.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata/BatchPredictOutputInfo.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOutputConfig.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictResult.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry/ConfidenceMetricsEntry.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingPoly.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationAnnotation.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfidenceMetricsEntry.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix/Row.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationType.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Dataset.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteDatasetRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteModelRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout/TextSegmentType.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions/DocumentDimensionUnit.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentInputConfig.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExamplePayload.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata/ExportDataOutputInfo.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata/ExportModelOutputInfo.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsDestination.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsSource.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetAnnotationSpecRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetDatasetRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelEvaluationRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Image.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationDatasetMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelDeploymentMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionAnnotation.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionDatasetMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionEvaluationMetrics.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelDeploymentMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/InputConfig.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsResponse.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsResponse.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsResponse.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model/DeploymentState.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelEvaluation.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelExportOutputConfig.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/NormalizedVertex.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OutputConfig.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictResponse.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationDatasetMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationModelMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionAnnotation.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionDatasetMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics/ConfidenceMetricsEntry.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionModelMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSegment.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentAnnotation.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentDatasetMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentEvaluationMetrics.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentModelMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSnippet.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationAnnotation.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationDatasetMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationEvaluationMetrics.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationModelMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelOperationMetadata.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateDatasetRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateModelRequest.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_dataset.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_model.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_dataset.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_model.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/deploy_model.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_data.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_model.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_annotation_spec.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_dataset.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model_evaluation.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/import_data.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_datasets.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_model_evaluations.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_models.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/undeploy_model.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_dataset.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_model.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/batch_predict.php create mode 100644 owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/predict.php create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/Client/AutoMlClient.php create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/Client/PredictionServiceClient.php create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_client_config.json create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_descriptor_config.php create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_rest_client_config.php create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_client_config.json create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_descriptor_config.php create mode 100644 owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_rest_client_config.php create mode 100644 owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/AutoMlClientTest.php create mode 100644 owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/PredictionServiceClientTest.php diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationPayload.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationPayload.php new file mode 100644 index 0000000000000000000000000000000000000000..9e9e65f15492f501633eaa4b51776353d1accb3b GIT binary patch literal 1802 zcmb`I-EPw`6vycX1w1rFg{IIe0~71SmeL_{kulIlM=3B`iK;>rXXM6_<4hZ9 z@4_{Y!YyyX3vi1+nsnWi@mVQVl$`VP@&EYz^Z04JAA`HFMIs`QBq1CeLAg(0EV$&D zGdM_xLn0vNi?yUlj*wn|NSDlqZji1QI6b@bb6E)VL2PJ~Hq6dD zVGCw;b+s-^6TclvA|k~6CP}cMvE-twLOpLpWUi)uQd^xYt8sJ)YqmzuJ5%Hqlp-Z3 zSBFp#nTlxB)U5%>`JMl3)s%`#GdiT$G{EzwTbvSqhtnjI7?J)S(Iba)_fQJ-A2@GG zB{V-1e!hXGpu)DiH^~T1bpy8o#h}G z)46DvkBXRWoz*c(`54TQUxDkV6nDz!mpMBNGq5&TG_brO&Sk@@7nP@3`8>>^s-S{$ zw+xb);DClsN#U+mZh~teO=5HUU1v{^&> zSe^dN^-)Z<@f+`s2bYt}(e7;d52nn>${$KV)%pDy@d2LJ#7 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationSpec.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationSpec.php new file mode 100644 index 000000000000..cf28095f3918 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/AnnotationSpec.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' +Ê +,google/cloud/automl/v1/annotation_spec.protogoogle.cloud.automl.v1"Ö +AnnotationSpec +name (  + display_name (  + example_count (:ˆêA„ +$automl.googleapis.com/AnnotationSpec\\projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}B  +com.google.cloud.automl.v1PZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Classification.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Classification.php new file mode 100644 index 0000000000000000000000000000000000000000..253a23b5d2584ead906f61172a6024f22ebc8d08 GIT binary patch literal 1852 zcmb_d&2Aev5U!-yiN|rOZW3p!1_+x3h}@qw1a&3H)0 z=OjDjBvCSxOh#m!PbORuCTEF=xbg@&I3kBfL()Fz4nN1xROX6tpG>8kMtqw^G7q5QidWt?;d`+c6#kY;q$F%YAch8Q&s#OS243t&J< zYY7T|0fN6IA4h_bG(&tw9*Z;(vB(6C#Lt+`9+}W6O(Zkh}B-7NrZgvuInT#hQNgWpOXw;-@rLFaA=`pkS3f3B6L?UoweFO zW!Sue*?qWkNsH`M@$^(i;ap1uO=OC%0BOIr-9qLoT4%)>jUu;fRQ&|j65J3vN0d=Z z{~6piuO_e{XFSlY!M$OOSeHp7u+`RDlpP1aA_g>TAa%WW7d8r1vu%s|0Pej5**L73 zxI1ujfo^tf<<nAg}o_na7z67*cUiiZ?K=b$!_y^C{jx%*9%78tVf14daG3*8VKP z$6EgPm#d`9_S} zMQWPO$`>!dS-$nd^MpH(@L~3v$H(1g-BxqhJvt1AF9z-4`Qh=P-NMcGLG>fNBG7-{ z8+MInwN$Ko&HZ+-THgPo1T~xoSLCvPd-+_`I0vPlc5FjgyihsYp323XpozdyVS7z7 z-d%kBUf%4Ok$?{vM}ntELciyoH2zu`M)P4|rbRy*;kfv_{HYD{eG}#THq7@=8sk+n bf1W-mdgNEO^YiaL9#qwA(b&sV^#GB^hfNk=*$=hN|t6@9>5Ie`_4Jve9W9Lz6!Z1# zV~m2(r@rkws2>l9I7GJZ2E@Ukj8MIU+8rIKbxnW4pphSkHdfHc_eTysu^m4ioLDjS zUFYQ0>B+#NmPsgfBUx|)c$SN!z_KxFbgL~)EgoVt1l*``xKR;s)CLUk6S zaTfR)5PJo2-yt@Ns72YwA&E@l5lSqF{KT3#M?=erFhf6#9mbwbiSHo}=y*0R9ixPk z#~ubgYx*3`>gjSFm8I9@QDl08r z#PIY1mB1NCa8U2mu3KtbH|rYvxY9ap^SZ6+?Cq+n*0c*vtru3L4Or9KwaY?^kwcAz zvtV8A71B};GTn~W)(fk}zca8gOC(iblXyW)O{U6_j6|>b@<)&Ls&PzBKqLjW22=4& zzQ>}yeEDD*$KsZ~gsfvt{FrO7TFRG=qh+XB#d1@`OAXkaXC2JJ@i_OIVD^}UaVTWTNN2FsXPE}X8<~Oc zOvL8r%ZJM&&fJg$y^UUa2YYc%5fTR(hRp3mZIB^0lTm zn}uBQ_Y`cauPrxlaMzkRzBQ0!$cTewx^K^ysU(gecH*4PwmUgf{)3kp_%qm;d2(t* zv@G9jS1wnoIam*pYOBAbV4n>JOF-S!59Q=Eo}EO#douE8vw;;5HXbAgbcxd~^EO><42yB#0@YKbcNH8WKrw(bPhD626MOm>LugC7t@y=>@ zHfpH+E?n~{JOtvpPr;d=T}N@2R^S_t$LBlW`OeRrZ@4g)jXu(uq93qs`IV&=nFuZrPbHEhU|3`ZU8$Hz6Xkf6>aj%b1B4|4TY zInpTr`O$u=Se{Z54Ox-oJX1110#ia}Ox20gH{JV=R=eX<+_fQi(%3_=vqw{{x-Vv=C55nZCJ` zx+)_MouueIyBKS#`QSV5YB!in>Qemxjohu1t5dy+{z7QuO*+`SVXXqw=Yj3>;H1~N z+koae!?yc7cN%OIq|upln@pCua+bH9r5P+}(@<3ju?BblzJji}$?=||TWaYcc0(D@ z-2nO@;a0c3wG~*O=fwr1CDwVYM)%QM-g9)%h>Xp!@+nVDNmogHLqeKJOfNpv17G`C zCF5vAXX~|GHx1V}OL$Ttz+o=O>{=uq46@ToUCf2 z2peq>TTUB@ZW*GlnuxTn-5S115u@9NqF||RmlQ*n%0y2f6>Gz%6dvP_kK9j-5VA!;W% zgUuA{c>Q9l0)VET`R^OAeRNsSF%yL!ZQ^x+epW%x&2QkO1domR zZmROr&I8mw^V4gi_2=x=NxOzFolsFS-)JIhU$@9FuLeJ(kKL1CCy8df2w-=H&b>z< zWZg_f_|lygp^$cB;I29@s=Wz!u0o3)554Ekb+vYWZ=nwOZ%}pAdb(wWR)Y-wZiVzDU ginternalAddGeneratedFile( + ' +Ø +&google/cloud/automl/v1/detection.protogoogle.cloud.automl.v1"k +ImageObjectDetectionAnnotation: + bounding_box ( 2$.google.cloud.automl.v1.BoundingPoly +score ("© +BoundingBoxMetricsEntry + iou_threshold ( +mean_average_precision (j +confidence_metrics_entries ( 2F.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryk +ConfidenceMetricsEntry +confidence_threshold ( +recall ( + precision ( +f1_score ("Ñ +%ImageObjectDetectionEvaluationMetrics$ +evaluated_bounding_box_count (U +bounding_box_metrics_entries ( 2/.google.cloud.automl.v1.BoundingBoxMetricsEntry+ +#bounding_box_mean_average_precision (B  +com.google.cloud.automl.v1PZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Geometry.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Geometry.php new file mode 100644 index 000000000000..72db1f5224ca --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Geometry.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' +ë +%google/cloud/automl/v1/geometry.protogoogle.cloud.automl.v1"( +NormalizedVertex +x ( +y ("U + BoundingPolyE +normalized_vertices ( 2(.google.cloud.automl.v1.NormalizedVertexB  +com.google.cloud.automl.v1PZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Image.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Image.php new file mode 100644 index 000000000000..44b8e2623603 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Image.php @@ -0,0 +1,58 @@ +internalAddGeneratedFile( + ' +£ +"google/cloud/automl/v1/image.protogoogle.cloud.automl.v1+google/cloud/automl/v1/classification.proto"r +"ImageClassificationDatasetMetadataL +classification_type (2*.google.cloud.automl.v1.ClassificationTypeBàA"% +#ImageObjectDetectionDatasetMetadata"÷ + ImageClassificationModelMetadata + base_model_id ( BàA* +train_budget_milli_node_hours (BàA( +train_cost_milli_node_hours (BàA + stop_reason ( BàA + +model_type ( BàA +node_qps (BàA + +node_count (BàA"Ü +!ImageObjectDetectionModelMetadata + +model_type ( BàA + +node_count (BàA +node_qps (BàA + stop_reason ( BàA* +train_budget_milli_node_hours (BàA( +train_cost_milli_node_hours (BàA"E +*ImageClassificationModelDeploymentMetadata + +node_count (BàA"F ++ImageObjectDetectionModelDeploymentMetadata + +node_count (BàAB¬ +com.google.cloud.automl.v1B +ImageProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Io.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Io.php new file mode 100644 index 0000000000000000000000000000000000000000..36f50727d932ee2e311bf3b62e63e031a461e08e GIT binary patch literal 1759 zcmcgt-EI;=6fU5R99oU5X|WeN#m3UaE>dGOOKStAr9=@Dn_ier$gn#L6PKNJc9yi7 z-uME(g4aHU*FJ^UK83ThKafed-dfBUEjoH_ZdITdf}~OK8ACZV>}@8SA>FV7V-`3pf<4?-mBd z0%f}50`PF31U|M1s@ebI0#Uk!6!iS<%b=YS||`$ z$hQ?5w5dl0#V-9QtKLEmb^{_|7h|2!vjk-xiU3W|BKb8Gb4IZ%K9gN;p-~~NsBzh} zS@#6t9(K(t2`o;1!FWrC8b+6hv0TwN`L$u%h>kiaAJ=FY7mD0Mf`?=>J3^d@kb5On zcSLY9eljnSsq9m8j}q6ekRBdT#tq}Nt5Xuy)cQ+0Y@ux16!YU8QN~sHl7oqHQtJY_K zM%#v2A9LIfvPqPZpu#lJL^i#p5WAk>$4l#wnfRz>AoZRcs|wQEJX{}OHzblfkxv`R z7m3OZn2n3fVOXqSVf9*^*whje{MzP~x~ZgomXrH46DeN9ohq}!KJm`bKf4lrj=)?q z6sMZ+!L3Mhn*@S-@;;b16#mgP4W;mMtw+(LdgmcC!IAp_*-2ggN6ODhSZpwxxVuL_ zzm{uL)R^K0c+fR^r`8eB7gBW&J{zjjSB| zRJwV5_kO1|dia)Hs3`~6m4oY%gEwC5hs7VGAIzb*D|2tSrgZmT$$K%#Fciu#VwhnZ f7CW=*@8ap|*rOiDt~p_{Qw>%{#x{5YCjh?zqR=n> literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Model.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Model.php new file mode 100644 index 0000000000000000000000000000000000000000..16324d2300317799f727d299923c65470d96f981 GIT binary patch literal 2364 zcmbtWZExE)5U!oI&FD4_)FSY_H`eV?2Uz4e1-4dMHaM~C8Hi)Aae{5tAkY%+vZEzI zqJnva|I0q_r|hQ`*oXatk*602s+|mNzL;X}dG4O$9gp9B@4xiX1Kgo54Tzu)9?h_L zNwFVz!m~Y&N6~mp18jR!pK%)K7`OWPxIe`0R(E(`LPIYKY--?%=S?`R+uVzsI*Eig z<@NJMed;-s>p+K)OQtmRiA`~5aL}WII7AS$14#2wA`uvq8t)7r(%;2b9YE4l}sp04r)iu%CON-6S^ zenp>wBpFmdmO8l$P9CpvqU5wQaGw4J`V{Cx>Z-bMMP9-duJBd# zB*%x^J#@=qq0h<8g54tQY6z)oJ*2{7PI(RX>ZoJ~R1O$R#Z3(n8j=zSbll z@+D0IC|wEYpiPJR+?#=9b@|frx*s_=vVXx zY7dV3Klj?lL+fPN9JZ~~Nf+ zz_X#pP5EwkQ~W3f83v#XBZe8qSz~kqO6~EZYyx~459157d*$2)%Xq}j(Hx=w03UJ= Alq;zxpP9mXc5D5hRc?4Kba( zp!ylmG*en}CF!J?P9dXQ%~K&E^C&$yr9YgG>EXfgcpFu7Rb(6jI#X&U!RJyHvCj&v z=F-0y`g0Y7jNpRFf@z@=&mt3&usP%@<3Nwj_D?{wm}wRsS&;Bs0}_rbNO(TnC4@_s z=k&yY9oAUnC8799i-{DR<{Ak&y)E)cBti=&#V>fFJvwDF2gGy)@}o^sGq_HpN&!xK7leC!SX^&{U)syPowA2&tfXL4OZ~h zI0vA?y7uiM#_(JpKGzxhA8>wzM2k88{0DO~mgMpc-BPE_7}+uS^R(Fjn`-yJ7G+|M z;<(PE@38C!b>vMR+$Db!a{rC$t$V|Xd$v41SDxO*u>W}rjIFmi4_wjqKWh<=t6-OM z_gdsMMl`~28PZa^%>*l*SAi>q2W`;H=#-K-OG(>ruxfpi05$|p;MQO3BeOH z>dh~8u4oQA6Fl#|PdkIn2VZ)QVAZAG)e>5ED{OK`{qZ~9pU5ZZgDRVvC^js`!#0ZX zQo9L1BRgWwW)P{#&sc>~9iJwuElai6Ms;j}PAyJd(@mV5Y+nsn6W6BYdep{cD!#7N zCK4dGR&uC`<%55Zk6}5ildy?qi@a;bQ?G+S8{IzXvLsPvx~L?|Q{a(^du#UHhh!@j zc`Dh9$ZA}-r#{)_8Q?gLOwRSLS$q1`t*eCe>YmWONj?HM)gZ&2kxk<6SQ=us?`9E$L+w~C!Oq84}YxPII=qc zmJ#j%-UxSqlkdIr;osGZu-p#pdT=5`+z(!@ee9Hiz-k47QwxIg;bh(V`-{7E3%%z? S?WM`wI+d-Y8=woaAmktJF)3aE literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Operations.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Operations.php new file mode 100644 index 0000000000000000000000000000000000000000..7388986ed973a503ba7f23a6b7303721a5987865 GIT binary patch literal 2846 zcmbW3|85&a5XWm5D4hUJkHmG{G%Ti4T&dj2E#;330o8Fx3=OeLh!8q-I`6HWmCm=T zyS<8l@*4cj-#h@XfIvJ6Pr>fqk2v++wZea$yz~9+%NF*+_V z@CzXMqOml!?HLh8`qV$Y2idj?N2jQl`e@rrPVOQR zC1i1Tgd!r6DBRJ0E5JqZ<-9sw&WPFeWmuP#GHnsr36%#Tyg7e;?Q@QuZ)NI}xLl*N z`0?j7%h^-kFH-cSETdi#lnQYh{#gZQ`!x&5Xr+dxt~4{PH1kEj^FapCWhPI|5_w!{ z<#q041`)@WI+G+T$?jh_;C4}9c|{r{c+V#R5ybUnk# zuqu0L7Lho1<@Jk6DBABz;+w`px#C6YwsohnGZJaiZlde5IgC6lvdPT!hA=Ex$MksgxQk$`zB80X zeJ!dzQj3Z`?!n!fvg`iYfV(wEZTtu;ED<~r^0k|?c0*_8Fi+)6H=k>qto zu(qHn{x`N@ZH8kv+uElQ!SeY#*Zbc*yf(NEx3aZ>Vg1^7e{I6O+Ey_3;T;;PP%sOp zbe08EdAlycMoPD*WrlY(B~6`@XH_X#q%3u(d1bW-zw!1|)9STHv0j(PA~13GdHtZ-!9_~B7nfBEak=GKhmlc2|`90t?J znooA}kKdcE13mbedhj#V;CJ-QJnjFTFF4sqsAs~Xz>!1Yzs-$QWZPP0+o{a9Py3U% g^nLPpyO=N@rbE`kOs3v`ic97(ZJ7>D7jOaaA6z=fy#N3J literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/PredictionService.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/PredictionService.php new file mode 100644 index 000000000000..4d2bbb57bded --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/PredictionService.php @@ -0,0 +1,68 @@ +internalAddGeneratedFile( + ' +ÿ +/google/cloud/automl/v1/prediction_service.protogoogle.cloud.automl.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto/google/cloud/automl/v1/annotation_payload.proto\'google/cloud/automl/v1/data_items.protogoogle/cloud/automl/v1/io.proto#google/longrunning/operations.proto"ô +PredictRequest1 +name ( B#àAúA +automl.googleapis.com/Model< +payload ( 2&.google.cloud.automl.v1.ExamplePayloadBàAB +params ( 22.google.cloud.automl.v1.PredictRequest.ParamsEntry- + ParamsEntry +key (  +value ( :8"‹ +PredictResponse: +payload ( 2).google.cloud.automl.v1.AnnotationPayloadB +preprocessed_input ( 2&.google.cloud.automl.v1.ExamplePayloadG +metadata ( 25.google.cloud.automl.v1.PredictResponse.MetadataEntry/ + MetadataEntry +key (  +value ( :8"Ú +BatchPredictRequest1 +name ( B#àAúA +automl.googleapis.com/ModelJ + input_config ( 2/.google.cloud.automl.v1.BatchPredictInputConfigBàAL + output_config ( 20.google.cloud.automl.v1.BatchPredictOutputConfigBàAG +params ( 27.google.cloud.automl.v1.BatchPredictRequest.ParamsEntry- + ParamsEntry +key (  +value ( :8"‘ +BatchPredictResultJ +metadata ( 28.google.cloud.automl.v1.BatchPredictResult.MetadataEntry/ + MetadataEntry +key (  +value ( :82… +PredictionService¯ +Predict&.google.cloud.automl.v1.PredictRequest\'.google.cloud.automl.v1.PredictResponse"SÚAname,payload,params‚Óä“7"2/v1/{name=projects/*/locations/*/models/*}:predict:*ò + BatchPredict+.google.cloud.automl.v1.BatchPredictRequest.google.longrunning.Operation"•ÊA\' +BatchPredictResultOperationMetadataÚA&name,input_config,output_config,params‚Óä“<"7/v1/{name=projects/*/locations/*/models/*}:batchPredict:*IÊAautoml.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB¸ +com.google.cloud.automl.v1BPredictionServiceProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Service.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Service.php new file mode 100644 index 0000000000000000000000000000000000000000..e5cc822384ebca5c8860a006fdf77967d211b626 GIT binary patch literal 8219 zcmc&(-ESP#74JI4kn05Mn*feOlwoX$V>Yu{JCtUO6UKHh7B;pBLd$983%ovp0WvlWY-t=ugyAyjkiDAMk59q2=(!M~uj>pC?pitQNwn{}e9 z<2kWoyUquIe_3nTZbaa0r);C;)ndo@GX9FMXUDhO;9qIxwzp~-Q zB=l^zvPPm>=mfDJ?trLi?vXfg9R17O6>%+9=QOlAj?pwbKrU->*dp26H7z7@EA*Ba zZmQrg`Ki*yS61LuEYI_)7kn==&D5q;h3ep{>kuy6Wf7oH0?by`u!XJ=x4Y5I)VHhG-cY6 zv*Wi9Y`4XdZ*WDMzPA^)JkRm=D%$~NoZ)geDM^-$TXytb_q$msU%lyw!nNx4q)uN3 z7Mn{di`Lm?^w;On>>%`opWsqPjS`i?NzOPZPd_P6+kpcFNNbDp-Snl*g9a_2>aM6D zA#gq;5Q;Jpk4oYZyDY<~c2f1#fER-}Q0#vof|M81DvK#0LtYChU7^#V$tz@}k?lYo zzmJk8O+z7bRdErMsgfkwg!qgQchih2`AJ3zA=#5y?*S$+@enj2Z@7g1%K|#L8WQMy zqMTnRKWdRE#y8M-V22RMse)FRJGFA<-`3dwtr_&R>(_YJ8XN(HJTjm=mNvx${5*PC z_;6|r&Q2^`5~A&CV~9IfPJnX#6*Rd{;x-tI=pouM1&C)Dh)d|A$h6XkaO3ZUG6|676b5<26z;tnjcDlFSfI1A=3nt~EZryknC zrFYC+r4(7EJd0+#S4v)m{!sy8&H}8nNtF-40cCWO5f`hCiG__$*>n+I=x!4`ss9|}MN5wT_8nIKI|yfCh`KLIxA3Cx?G|;(uOrNh?LobDh%l#) zHbo+MoHlx+WWgJeH2yP24GCQTe(wICqHCE)#_r_TQ(bZyd*yrh$H?FS*!tx(9NzMJTu)oT#KKC?>sRS6 zmnc);K77`%TtMfQuF*H3KX}|{>{40Y!{4L-7Knng;R9;IuXZQHlFEbZK7Ms4FTRD& zOX^6ca%tvLjzq395~*B9&-7rCREhrU0=keCa{Bj#Sr*&oq(MjupUqDbyo3fEDLz0? zb;lzp#zNocsgRD0V#KIi?(N)U#8eW`!q*qjxCO5#wp{$T0y>kM9C1;lJ|`x^GM%tW zW`Z@6ok(vUSx=#d#YBfElLxX&kF7`fd|DKP)JI?a_cvoN=tcU@<) zl#H#V`NNW&y-Yc%;@=ezN~ceJMP*7VBkkxn-0Dlm7Mo!iKm&7tbf{IpOV9yQ{D%TM zO~Wl55#i@l$g)xrn=&GKVV*hq^06gm{v6Z+eTn}F36Yya)d`UklVJNg@||PrtcYAO zGodoDw-&Cmz>DX`fc{Mr;0r*X8(`Jwb7B&GpLE_ovgXm_d|%megl`TJ znv$Koh@p!Ju7>M2oFB%^pMeRPRY+|@MySJt z?y5U`n@vfWgmzJ>~ z$3bM4O84&F6Ofaa_i$vNf4aUJxOUv|!{!Q5;xxS2S6H_)!56_D`jvR6@b&^HKQZFc z4+49>{AdH$z*fd#1-nb~hfl|zSZ5!;jaBwNi7DJP?v{__gNpbh&c2CnxfS>*{=c#F s{E%s~Q>Mv}ndaT{?l^lry?8nKzE$MknKPfIm7k=UB>!}Lhz=3@27e|TKmY&$ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Text.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Text.php new file mode 100644 index 000000000000..9099b4c7bb52 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Text.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + ' +à +!google/cloud/automl/v1/text.protogoogle.cloud.automl.v1"l +!TextClassificationDatasetMetadataG +classification_type (2*.google.cloud.automl.v1.ClassificationType"j +TextClassificationModelMetadataG +classification_type (2*.google.cloud.automl.v1.ClassificationType" +TextExtractionDatasetMetadata" +TextExtractionModelMetadata"5 +TextSentimentDatasetMetadata + sentiment_max (" +TextSentimentModelMetadataB« +com.google.cloud.automl.v1B TextProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextExtraction.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextExtraction.php new file mode 100644 index 0000000000000000000000000000000000000000..2243852022ffd84c643310ac2796a5f2d0d03d86 GIT binary patch literal 1263 zcmb7E?QYXB6s6sVzzoD9G?fVnvrSqjjZ_`~TngGpDU;Y%iD^Gjq{?-i*21wP+o>36 zFToS=n@8bMcm{sp*lpHn8;D3ztmNKv&pr2^yn2(3GO!N2R8WNtjp5)Nnh}MWl138A z;UG^EsvwbR#yC|Wga;?^_~aCJ4h~PB+f*%cMJR$pDTkak2$y->z`2nrZ;YD_LqD6o zy%i>gNfA0=00d5{&M={{+uJ*$2FKXosOvDI{Q@J}br{iEvjqU*SZjD{aXKXw_zIxC zvV6c9f!bhW9~(^fnP7%t&c4`o+AzUfQwwoDHpzwK1dD_dL1=voddwnrBa^oMHk^{` z6^d9jqC;V*5|~E^R1?KABUR6aA~d9?)UkL|-N zqUCrO02k#c`nP0JA=L*uOsOykUG{eg=h}PmnoXM7jpLI0TRZ4_S*@tO34YIm?f;o@ zu;Qabw-2G;hj83nGoW^LjJra}Vs=slEwJR)MSJ44IasOR-&qfDh6-nTe0L{!02VZn ziqv2KO@if@v#jZN3mBcm(by&Ayjt!AbPJQgoQ!(n7EDamNpDD!)t{LpilJ&X{$# zpKCT~O%Fe+D_v*e(3vJy)Ykjp~Iry+FK94xv& Z#>>reA-BC*X1sN)uUw?x`3rCXz#nN?oYw#V literal 0 HcmV?d00001 diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSegment.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSegment.php new file mode 100644 index 000000000000..751b2c2cfe63 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSegment.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' +Ê +)google/cloud/automl/v1/text_segment.protogoogle.cloud.automl.v1"H + TextSegment +content (  + start_offset ( + +end_offset (B² +com.google.cloud.automl.v1BTextSegmentProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSentiment.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSentiment.php new file mode 100644 index 000000000000..4ca9eee82cee --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/TextSentiment.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile( + ' +Õ ++google/cloud/automl/v1/text_sentiment.protogoogle.cloud.automl.v1", +TextSentimentAnnotation + sentiment ("  +TextSentimentEvaluationMetrics + precision ( +recall ( +f1_score ( +mean_absolute_error ( +mean_squared_error ( + linear_kappa ( +quadratic_kappa (a +confusion_matrix ( 2G.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixB´ +com.google.cloud.automl.v1BTextSentimentProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Translation.php b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Translation.php new file mode 100644 index 000000000000..abb31035d744 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/GPBMetadata/Google/Cloud/Automl/V1/Translation.php @@ -0,0 +1,43 @@ +internalAddGeneratedFile( + ' +Ÿ +(google/cloud/automl/v1/translation.protogoogle.cloud.automl.v1\'google/cloud/automl/v1/data_items.proto"b +TranslationDatasetMetadata! +source_language_code ( BàA! +target_language_code ( BàA"K +TranslationEvaluationMetrics + +bleu_score ( +base_bleu_score ("j +TranslationModelMetadata + +base_model (  +source_language_code (  +target_language_code ( "X +TranslationAnnotation? +translated_content ( 2#.google.cloud.automl.v1.TextSnippetB² +com.google.cloud.automl.v1BTranslationProtoPZ2cloud.google.com/go/automl/apiv1/automlpb;automlpbªGoogle.Cloud.AutoML.V1ÊGoogle\\Cloud\\AutoMl\\V1êGoogle::Cloud::AutoML::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationPayload.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationPayload.php new file mode 100644 index 000000000000..f21999b9d69d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationPayload.php @@ -0,0 +1,303 @@ +google.cloud.automl.v1.AnnotationPayload + */ +class AnnotationPayload extends \Google\Protobuf\Internal\Message +{ + /** + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * + * Generated from protobuf field string annotation_spec_id = 1; + */ + protected $annotation_spec_id = ''; + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * + * Generated from protobuf field string display_name = 5; + */ + protected $display_name = ''; + protected $detail; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TranslationAnnotation $translation + * Annotation details for translation. + * @type \Google\Cloud\AutoMl\V1\ClassificationAnnotation $classification + * Annotation details for content or image classification. + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionAnnotation $image_object_detection + * Annotation details for image object detection. + * @type \Google\Cloud\AutoMl\V1\TextExtractionAnnotation $text_extraction + * Annotation details for text extraction. + * @type \Google\Cloud\AutoMl\V1\TextSentimentAnnotation $text_sentiment + * Annotation details for text sentiment. + * @type string $annotation_spec_id + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * @type string $display_name + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\AnnotationPayload::initOnce(); + parent::__construct($data); + } + + /** + * Annotation details for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationAnnotation translation = 2; + * @return \Google\Cloud\AutoMl\V1\TranslationAnnotation|null + */ + public function getTranslation() + { + return $this->readOneof(2); + } + + public function hasTranslation() + { + return $this->hasOneof(2); + } + + /** + * Annotation details for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationAnnotation translation = 2; + * @param \Google\Cloud\AutoMl\V1\TranslationAnnotation $var + * @return $this + */ + public function setTranslation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationAnnotation::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Annotation details for content or image classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + * @return \Google\Cloud\AutoMl\V1\ClassificationAnnotation|null + */ + public function getClassification() + { + return $this->readOneof(3); + } + + public function hasClassification() + { + return $this->hasOneof(3); + } + + /** + * Annotation details for content or image classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationAnnotation classification = 3; + * @param \Google\Cloud\AutoMl\V1\ClassificationAnnotation $var + * @return $this + */ + public function setClassification($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ClassificationAnnotation::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Annotation details for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionAnnotation|null + */ + public function getImageObjectDetection() + { + return $this->readOneof(4); + } + + public function hasImageObjectDetection() + { + return $this->hasOneof(4); + } + + /** + * Annotation details for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionAnnotation image_object_detection = 4; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionAnnotation $var + * @return $this + */ + public function setImageObjectDetection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionAnnotation::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Annotation details for text extraction. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + * @return \Google\Cloud\AutoMl\V1\TextExtractionAnnotation|null + */ + public function getTextExtraction() + { + return $this->readOneof(6); + } + + public function hasTextExtraction() + { + return $this->hasOneof(6); + } + + /** + * Annotation details for text extraction. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionAnnotation text_extraction = 6; + * @param \Google\Cloud\AutoMl\V1\TextExtractionAnnotation $var + * @return $this + */ + public function setTextExtraction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextExtractionAnnotation::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Annotation details for text sentiment. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + * @return \Google\Cloud\AutoMl\V1\TextSentimentAnnotation|null + */ + public function getTextSentiment() + { + return $this->readOneof(7); + } + + public function hasTextSentiment() + { + return $this->hasOneof(7); + } + + /** + * Annotation details for text sentiment. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentAnnotation text_sentiment = 7; + * @param \Google\Cloud\AutoMl\V1\TextSentimentAnnotation $var + * @return $this + */ + public function setTextSentiment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSentimentAnnotation::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * + * Generated from protobuf field string annotation_spec_id = 1; + * @return string + */ + public function getAnnotationSpecId() + { + return $this->annotation_spec_id; + } + + /** + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * + * Generated from protobuf field string annotation_spec_id = 1; + * @param string $var + * @return $this + */ + public function setAnnotationSpecId($var) + { + GPBUtil::checkString($var, True); + $this->annotation_spec_id = $var; + + return $this; + } + + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * + * Generated from protobuf field string display_name = 5; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * + * Generated from protobuf field string display_name = 5; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * @return string + */ + public function getDetail() + { + return $this->whichOneof("detail"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationSpec.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationSpec.php new file mode 100644 index 000000000000..3bfaaba11c7b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/AnnotationSpec.php @@ -0,0 +1,151 @@ +google.cloud.automl.v1.AnnotationSpec + */ +class AnnotationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of the annotation spec. + * Form: + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * + * Generated from protobuf field int32 example_count = 9; + */ + protected $example_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Resource name of the annotation spec. + * Form: + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * @type string $display_name + * Required. The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * @type int $example_count + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\AnnotationSpec::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Resource name of the annotation spec. + * Form: + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of the annotation spec. + * Form: + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * + * 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; + } + + /** + * Required. The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * + * 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; + } + + /** + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * + * Generated from protobuf field int32 example_count = 9; + * @return int + */ + public function getExampleCount() + { + return $this->example_count; + } + + /** + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * + * Generated from protobuf field int32 example_count = 9; + * @param int $var + * @return $this + */ + public function setExampleCount($var) + { + GPBUtil::checkInt32($var); + $this->example_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictInputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictInputConfig.php new file mode 100644 index 000000000000..a7c1163a47f4 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictInputConfig.php @@ -0,0 +1,271 @@ + + * "First Name","Last Name","Dob","Addresses" + * "John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]" + * "Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]} + * + * **For bigquery_source:** + * The URI of a BigQuery table. The user data size of the BigQuery + * table must be 100GB or smaller. + * The column names must contain the model's + * [input_feature_column_specs'][google.cloud.automl.v1.TablesModelMetadata.input_feature_column_specs] + * [display_name-s][google.cloud.automl.v1.ColumnSpec.display_name] + * (order doesn't matter). The columns corresponding to the model's + * input feature column specs must contain values compatible with the + * column spec's data types. Prediction on all the rows of the table + * will be attempted. + * **Input field definitions:** + * `GCS_FILE_PATH` + * : The path to a file on Google Cloud Storage. For example, + * "gs://folder/video.avi". + * `TIME_SEGMENT_START` + * : (`TIME_OFFSET`) + * Expresses a beginning, inclusive, of a time segment + * within an example that has a time dimension + * (e.g. video). + * `TIME_SEGMENT_END` + * : (`TIME_OFFSET`) + * Expresses an end, exclusive, of a time segment within + * n example that has a time dimension (e.g. video). + * `TIME_OFFSET` + * : A number of seconds as measured from the start of an + * example (e.g. video). Fractions are allowed, up to a + * microsecond precision. "inf" is allowed, and it means the end + * of the example. + * **Errors:** + * If any of the provided CSV files can't be parsed or if more than certain + * percent of CSV rows cannot be processed then the operation fails and + * prediction does not happen. Regardless of overall success or failure the + * per-row failures, up to a certain count cap, will be listed in + * Operation.metadata.partial_failures. + * + * Generated from protobuf message google.cloud.automl.v1.BatchPredictInputConfig + */ +class BatchPredictInputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsSource $gcs_source + * Required. The Google Cloud Storage location for the input content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * Required. The Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata.php new file mode 100644 index 000000000000..e4da433620a5 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata.php @@ -0,0 +1,125 @@ +google.cloud.automl.v1.BatchPredictOperationMetadata + */ +class BatchPredictOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The input config that was given upon starting this + * batch predict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + */ + protected $input_config = null; + /** + * Output only. Information further describing this batch predict's output. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + */ + protected $output_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $input_config + * Output only. The input config that was given upon starting this + * batch predict operation. + * @type \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata\BatchPredictOutputInfo $output_info + * Output only. Information further describing this batch predict's output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The input config that was given upon starting this + * batch predict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + * @return \Google\Cloud\AutoMl\V1\BatchPredictInputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Output only. The input config that was given upon starting this + * batch predict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 1; + * @param \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Output only. Information further describing this batch predict's output. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * @return \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata\BatchPredictOutputInfo|null + */ + public function getOutputInfo() + { + return $this->output_info; + } + + public function hasOutputInfo() + { + return isset($this->output_info); + } + + public function clearOutputInfo() + { + unset($this->output_info); + } + + /** + * Output only. Information further describing this batch predict's output. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo output_info = 2; + * @param \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata\BatchPredictOutputInfo $var + * @return $this + */ + public function setOutputInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata\BatchPredictOutputInfo::class); + $this->output_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata/BatchPredictOutputInfo.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata/BatchPredictOutputInfo.php new file mode 100644 index 000000000000..602511a659d7 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOperationMetadata/BatchPredictOutputInfo.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + */ +class BatchPredictOutputInfo extends \Google\Protobuf\Internal\Message +{ + protected $output_location; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_output_directory + * The full path of the Google Cloud Storage directory created, into which + * the prediction output is written. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the prediction output is written. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @return string + */ + public function getGcsOutputDirectory() + { + return $this->readOneof(1); + } + + public function hasGcsOutputDirectory() + { + return $this->hasOneof(1); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the prediction output is written. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @param string $var + * @return $this + */ + public function setGcsOutputDirectory($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getOutputLocation() + { + return $this->whichOneof("output_location"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BatchPredictOutputInfo::class, \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata_BatchPredictOutputInfo::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOutputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOutputConfig.php new file mode 100644 index 000000000000..90d16feeab7f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictOutputConfig.php @@ -0,0 +1,311 @@ +-", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents + * of it depends on the ML problem the predictions are made for. + * * For Image Classification: + * In the created directory files `image_classification_1.jsonl`, + * `image_classification_2.jsonl`,...,`image_classification_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of the successfully predicted images and annotations. + * A single image will be listed only once with all its annotations, + * and its annotations will never be split across files. + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps image's "ID" : "" followed by a list of + * zero or more AnnotationPayload protos (called annotations), which + * have classification detail populated. + * If prediction for any image failed (partially or completely), then an + * additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` + * files will be created (N depends on total number of failed + * predictions). These files will have a JSON representation of a proto + * that wraps the same "ID" : "" but here followed by + * exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`fields. + * * For Image Object Detection: + * In the created directory files `image_object_detection_1.jsonl`, + * `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of the successfully predicted images and annotations. + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps image's "ID" : "" followed by a list of + * zero or more AnnotationPayload protos (called annotations), which + * have image_object_detection detail populated. A single image will + * be listed only once with all its annotations, and its annotations + * will never be split across files. + * If prediction for any image failed (partially or completely), then + * additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` + * files will be created (N depends on total number of failed + * predictions). These files will have a JSON representation of a proto + * that wraps the same "ID" : "" but here followed by + * exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`fields. + * * For Video Classification: + * In the created directory a video_classification.csv file, and a .JSON + * file per each video classification requested in the input (i.e. each + * line in given CSV(s)), will be created. + * The format of video_classification.csv is: + * GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS + * where: + * GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 + * the prediction input lines (i.e. video_classification.csv has + * precisely the same number of lines as the prediction input had.) + * JSON_FILE_NAME = Name of .JSON file in the output directory, which + * contains prediction responses for the video time segment. + * STATUS = "OK" if prediction completed successfully, or an error code + * with message otherwise. If STATUS is not "OK" then the .JSON file + * for that line may not exist or be empty. + * Each .JSON file, assuming STATUS is "OK", will contain a list of + * AnnotationPayload protos in JSON format, which are the predictions + * for the video time segment the file is assigned to in the + * video_classification.csv. All AnnotationPayload protos will have + * video_classification field set, and will be sorted by + * video_classification.type field (note that the returned types are + * governed by `classifaction_types` parameter in + * [PredictService.BatchPredictRequest.params][]). + * * For Video Object Tracking: + * In the created directory a video_object_tracking.csv file will be + * created, and multiple files video_object_trackinng_1.json, + * video_object_trackinng_2.json,..., video_object_trackinng_N.json, + * where N is the number of requests in the input (i.e. the number of + * lines in given CSV(s)). + * The format of video_object_tracking.csv is: + * GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS + * where: + * GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 + * the prediction input lines (i.e. video_object_tracking.csv has + * precisely the same number of lines as the prediction input had.) + * JSON_FILE_NAME = Name of .JSON file in the output directory, which + * contains prediction responses for the video time segment. + * STATUS = "OK" if prediction completed successfully, or an error + * code with message otherwise. If STATUS is not "OK" then the .JSON + * file for that line may not exist or be empty. + * Each .JSON file, assuming STATUS is "OK", will contain a list of + * AnnotationPayload protos in JSON format, which are the predictions + * for each frame of the video time segment the file is assigned to in + * video_object_tracking.csv. All AnnotationPayload protos will have + * video_object_tracking field set. + * * For Text Classification: + * In the created directory files `text_classification_1.jsonl`, + * `text_classification_2.jsonl`,...,`text_classification_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps input text file (or document) in + * the text snippet (or document) proto and a list of + * zero or more AnnotationPayload protos (called annotations), which + * have classification detail populated. A single text file (or + * document) will be listed only once with all its annotations, and its + * annotations will never be split across files. + * If prediction for any input file (or document) failed (partially or + * completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps input file followed by exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * * For Text Sentiment: + * In the created directory files `text_sentiment_1.jsonl`, + * `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps input text file (or document) in + * the text snippet (or document) proto and a list of + * zero or more AnnotationPayload protos (called annotations), which + * have text_sentiment detail populated. A single text file (or + * document) will be listed only once with all its annotations, and its + * annotations will never be split across files. + * If prediction for any input file (or document) failed (partially or + * completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps input file followed by exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * * For Text Extraction: + * In the created directory files `text_extraction_1.jsonl`, + * `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * The contents of these .JSONL file(s) depend on whether the input + * used inline text, or documents. + * If input was inline, then each .JSONL file will contain, per line, + * a JSON representation of a proto that wraps given in request text + * snippet's "id" (if specified), followed by input text snippet, + * and a list of zero or more + * AnnotationPayload protos (called annotations), which have + * text_extraction detail populated. A single text snippet will be + * listed only once with all its annotations, and its annotations will + * never be split across files. + * If input used documents, then each .JSONL file will contain, per + * line, a JSON representation of a proto that wraps given in request + * document proto, followed by its OCR-ed representation in the form + * of a text snippet, finally followed by a list of zero or more + * AnnotationPayload protos (called annotations), which have + * text_extraction detail populated and refer, via their indices, to + * the OCR-ed text snippet. A single document (and its text snippet) + * will be listed only once with all its annotations, and its + * annotations will never be split across files. + * If prediction for any text snippet failed (partially or completely), + * then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps either the "id" : "" (in case of inline) + * or the document proto (in case of document) but here followed by + * exactly one + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * * For Tables: + * Output depends on whether + * [gcs_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.gcs_destination] + * or + * [bigquery_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.bigquery_destination] + * is set (either is allowed). + * Google Cloud Storage case: + * In the created directory files `tables_1.csv`, `tables_2.csv`,..., + * `tables_N.csv` will be created, where N may be 1, and depends on + * the total number of the successfully predicted rows. + * For all CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: + * Each .csv file will contain a header, listing all columns' + * [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] + * given on input followed by M target column names in the format of + * "<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] + * [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>__score" where M is the number of distinct target values, + * i.e. number of distinct values in the target column of the table + * used to train the model. Subsequent lines will contain the + * respective values of successfully predicted rows, with the last, + * i.e. the target, columns having the corresponding prediction + * [scores][google.cloud.automl.v1p1beta.TablesAnnotation.score]. + * For REGRESSION and FORECASTING + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: + * Each .csv file will contain a header, listing all columns' + * [display_name-s][google.cloud.automl.v1p1beta.display_name] + * given on input followed by the predicted target column with name + * in the format of + * "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] + * [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" + * Subsequent lines will contain the respective values of + * successfully predicted rows, with the last, i.e. the target, + * column having the predicted target value. + * If prediction for any rows failed, then an additional + * `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be + * created (N depends on total number of failed rows). These files + * will have analogous format as `tables_*.csv`, but always with a + * single target column having + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * represented as a JSON string, and containing only `code` and + * `message`. + * BigQuery case: + * [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination] + * pointing to a BigQuery project must be set. In the given project a + * new dataset will be created with name + * `prediction__` + * where will be made + * BigQuery-dataset-name compatible (e.g. most special characters will + * become underscores), and timestamp will be in + * YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset + * two tables will be created, `predictions`, and `errors`. + * The `predictions` table's column names will be the input columns' + * [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] + * followed by the target column with name in the format of + * "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] + * [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" + * The input feature columns will contain the respective values of + * successfully predicted rows, with the target column having an + * ARRAY of + * [AnnotationPayloads][google.cloud.automl.v1p1beta.AnnotationPayload], + * represented as STRUCT-s, containing + * [TablesAnnotation][google.cloud.automl.v1p1beta.TablesAnnotation]. + * The `errors` table contains rows for which the prediction has + * failed, it has analogous input columns while the target column name + * is in the format of + * "errors_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] + * [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>", + * and as a value has + * [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * represented as a STRUCT, and containing only `code` and `message`. + * + * Generated from protobuf message google.cloud.automl.v1.BatchPredictOutputConfig + */ +class BatchPredictOutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsDestination $gcs_destination + * Required. The Google Cloud Storage location of the directory where the + * output is to be written to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Google Cloud Storage location of the directory where the + * output is to be written to. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Required. The Google Cloud Storage location of the directory where the + * output is to be written to. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictRequest.php new file mode 100644 index 000000000000..581405bbbb17 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictRequest.php @@ -0,0 +1,553 @@ +google.cloud.automl.v1.BatchPredictRequest + */ +class BatchPredictRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the model requested to serve the batch prediction. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The input configuration for batch prediction. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * Required. The Configuration specifying where output predictions should + * be written. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * Generated from protobuf field map params = 5; + */ + private $params; + + /** + * @param string $name Required. Name of the model requested to serve the batch prediction. Please see + * {@see PredictionServiceClient::modelName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $inputConfig Required. The input configuration for batch prediction. + * @param \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig $outputConfig Required. The Configuration specifying where output predictions should + * be written. + * @param array $params Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * + * AutoML Natural Language Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * + * + * AutoML Vision Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * AutoML Vision Object Detection + * + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * + * AutoML Video Intelligence Object Tracking + * + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * + * @return \Google\Cloud\AutoMl\V1\BatchPredictRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $inputConfig, \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig $outputConfig, array $params): self + { + return (new self()) + ->setName($name) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig) + ->setParams($params); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the model requested to serve the batch prediction. + * @type \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $input_config + * Required. The input configuration for batch prediction. + * @type \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig $output_config + * Required. The Configuration specifying where output predictions should + * be written. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the model requested to serve the batch prediction. + * + * 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. Name of the model requested to serve the batch prediction. + * + * 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; + } + + /** + * Required. The input configuration for batch prediction. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\BatchPredictInputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. The input configuration for batch prediction. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictInputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\BatchPredictInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Required. The Configuration specifying where output predictions should + * be written. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The Configuration specifying where output predictions should + * be written. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOutputConfig output_config = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictOutputConfig::class); + $this->output_config = $var; + + return $this; + } + + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * Generated from protobuf field map params = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * Generated from protobuf field map params = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->params = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictResult.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictResult.php new file mode 100644 index 000000000000..cba80eebfee9 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BatchPredictResult.php @@ -0,0 +1,93 @@ +google.cloud.automl.v1.BatchPredictResult + */ +class BatchPredictResult extends \Google\Protobuf\Internal\Message +{ + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per image. + * AutoML Video Intelligence Object Tracking + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per frame. + * + * Generated from protobuf field map metadata = 1; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per image. + * AutoML Video Intelligence Object Tracking + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per frame. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per image. + * AutoML Video Intelligence Object Tracking + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per frame. + * + * Generated from protobuf field map metadata = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per image. + * AutoML Video Intelligence Object Tracking + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes returned per frame. + * + * Generated from protobuf field map metadata = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry.php new file mode 100644 index 000000000000..375e95b8e033 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry.php @@ -0,0 +1,148 @@ +google.cloud.automl.v1.BoundingBoxMetricsEntry + */ +class BoundingBoxMetricsEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * + * Generated from protobuf field float iou_threshold = 1; + */ + protected $iou_threshold = 0.0; + /** + * Output only. The mean average precision, most often close to au_prc. + * + * Generated from protobuf field float mean_average_precision = 2; + */ + protected $mean_average_precision = 0.0; + /** + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + */ + private $confidence_metrics_entries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $iou_threshold + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * @type float $mean_average_precision + * Output only. The mean average precision, most often close to au_prc. + * @type array<\Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $confidence_metrics_entries + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Detection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * + * Generated from protobuf field float iou_threshold = 1; + * @return float + */ + public function getIouThreshold() + { + return $this->iou_threshold; + } + + /** + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * + * Generated from protobuf field float iou_threshold = 1; + * @param float $var + * @return $this + */ + public function setIouThreshold($var) + { + GPBUtil::checkFloat($var); + $this->iou_threshold = $var; + + return $this; + } + + /** + * Output only. The mean average precision, most often close to au_prc. + * + * Generated from protobuf field float mean_average_precision = 2; + * @return float + */ + public function getMeanAveragePrecision() + { + return $this->mean_average_precision; + } + + /** + * Output only. The mean average precision, most often close to au_prc. + * + * Generated from protobuf field float mean_average_precision = 2; + * @param float $var + * @return $this + */ + public function setMeanAveragePrecision($var) + { + GPBUtil::checkFloat($var); + $this->mean_average_precision = $var; + + return $this; + } + + /** + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConfidenceMetricsEntries() + { + return $this->confidence_metrics_entries; + } + + /** + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3; + * @param array<\Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConfidenceMetricsEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry\ConfidenceMetricsEntry::class); + $this->confidence_metrics_entries = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry/ConfidenceMetricsEntry.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry/ConfidenceMetricsEntry.php new file mode 100644 index 000000000000..7b96c02b4d5a --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingBoxMetricsEntry/ConfidenceMetricsEntry.php @@ -0,0 +1,172 @@ +google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + */ +class ConfidenceMetricsEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The confidence threshold value used to compute the metrics. + * + * Generated from protobuf field float confidence_threshold = 1; + */ + protected $confidence_threshold = 0.0; + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + */ + protected $precision = 0.0; + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + */ + protected $f1_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $confidence_threshold + * Output only. The confidence threshold value used to compute the metrics. + * @type float $recall + * Output only. Recall under the given confidence threshold. + * @type float $precision + * Output only. Precision under the given confidence threshold. + * @type float $f1_score + * Output only. The harmonic mean of recall and precision. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Detection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The confidence threshold value used to compute the metrics. + * + * Generated from protobuf field float confidence_threshold = 1; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Output only. The confidence threshold value used to compute the metrics. + * + * Generated from protobuf field float confidence_threshold = 1; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 2; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + * @param float $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkFloat($var); + $this->precision = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + * @param float $var + * @return $this + */ + public function setF1Score($var) + { + GPBUtil::checkFloat($var); + $this->f1_score = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfidenceMetricsEntry::class, \Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry_ConfidenceMetricsEntry::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingPoly.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingPoly.php new file mode 100644 index 000000000000..9155aadb93dd --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/BoundingPoly.php @@ -0,0 +1,69 @@ +google.cloud.automl.v1.BoundingPoly + */ +class BoundingPoly extends \Google\Protobuf\Internal\Message +{ + /** + * Output only . The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + */ + private $normalized_vertices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AutoMl\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $normalized_vertices + * Output only . The bounding polygon normalized vertices. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Geometry::initOnce(); + parent::__construct($data); + } + + /** + * Output only . The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNormalizedVertices() + { + return $this->normalized_vertices; + } + + /** + * Output only . The bounding polygon normalized vertices. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.NormalizedVertex normalized_vertices = 2; + * @param array<\Google\Cloud\AutoMl\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNormalizedVertices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\NormalizedVertex::class); + $this->normalized_vertices = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationAnnotation.php new file mode 100644 index 000000000000..1a78afa7261b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationAnnotation.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.ClassificationAnnotation + */ +class ClassificationAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * + * Generated from protobuf field float score = 1; + */ + protected $score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $score + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * + * Generated from protobuf field float score = 1; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * + * Generated from protobuf field float score = 1; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics.php new file mode 100644 index 000000000000..4391dc5673d6 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics.php @@ -0,0 +1,293 @@ +google.cloud.automl.v1.ClassificationEvaluationMetrics + */ +class ClassificationEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * + * Generated from protobuf field float au_prc = 1; + */ + protected $au_prc = 0.0; + /** + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * + * Generated from protobuf field float au_roc = 6; + */ + protected $au_roc = 0.0; + /** + * Output only. The Log Loss metric. + * + * Generated from protobuf field float log_loss = 7; + */ + protected $log_loss = 0.0; + /** + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + */ + private $confidence_metrics_entry; + /** + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + */ + protected $confusion_matrix = null; + /** + * Output only. The annotation spec ids used for this evaluation. + * + * Generated from protobuf field repeated string annotation_spec_id = 5; + */ + private $annotation_spec_id; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $au_prc + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * @type float $au_roc + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * @type float $log_loss + * Output only. The Log Loss metric. + * @type array<\Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $confidence_metrics_entry + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * @type \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix $confusion_matrix + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * @type array|\Google\Protobuf\Internal\RepeatedField $annotation_spec_id + * Output only. The annotation spec ids used for this evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * + * Generated from protobuf field float au_prc = 1; + * @return float + */ + public function getAuPrc() + { + return $this->au_prc; + } + + /** + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * + * Generated from protobuf field float au_prc = 1; + * @param float $var + * @return $this + */ + public function setAuPrc($var) + { + GPBUtil::checkFloat($var); + $this->au_prc = $var; + + return $this; + } + + /** + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * + * Generated from protobuf field float au_roc = 6; + * @return float + */ + public function getAuRoc() + { + return $this->au_roc; + } + + /** + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * + * Generated from protobuf field float au_roc = 6; + * @param float $var + * @return $this + */ + public function setAuRoc($var) + { + GPBUtil::checkFloat($var); + $this->au_roc = $var; + + return $this; + } + + /** + * Output only. The Log Loss metric. + * + * Generated from protobuf field float log_loss = 7; + * @return float + */ + public function getLogLoss() + { + return $this->log_loss; + } + + /** + * Output only. The Log Loss metric. + * + * Generated from protobuf field float log_loss = 7; + * @param float $var + * @return $this + */ + public function setLogLoss($var) + { + GPBUtil::checkFloat($var); + $this->log_loss = $var; + + return $this; + } + + /** + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConfidenceMetricsEntry() + { + return $this->confidence_metrics_entry; + } + + /** + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3; + * @param array<\Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConfidenceMetricsEntry($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry::class); + $this->confidence_metrics_entry = $arr; + + return $this; + } + + /** + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * @return \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix|null + */ + public function getConfusionMatrix() + { + return $this->confusion_matrix; + } + + public function hasConfusionMatrix() + { + return isset($this->confusion_matrix); + } + + public function clearConfusionMatrix() + { + unset($this->confusion_matrix); + } + + /** + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4; + * @param \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix $var + * @return $this + */ + public function setConfusionMatrix($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix::class); + $this->confusion_matrix = $var; + + return $this; + } + + /** + * Output only. The annotation spec ids used for this evaluation. + * + * Generated from protobuf field repeated string annotation_spec_id = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotationSpecId() + { + return $this->annotation_spec_id; + } + + /** + * Output only. The annotation spec ids used for this evaluation. + * + * Generated from protobuf field repeated string annotation_spec_id = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotationSpecId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotation_spec_id = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfidenceMetricsEntry.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfidenceMetricsEntry.php new file mode 100644 index 000000000000..edfbb3a2f738 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfidenceMetricsEntry.php @@ -0,0 +1,568 @@ +google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + */ +class ConfidenceMetricsEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * + * Generated from protobuf field float confidence_threshold = 1; + */ + protected $confidence_threshold = 0.0; + /** + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * + * Generated from protobuf field int32 position_threshold = 14; + */ + protected $position_threshold = 0; + /** + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + /** + * Output only. Precision for the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + */ + protected $precision = 0.0; + /** + * Output only. False Positive Rate for the given confidence threshold. + * + * Generated from protobuf field float false_positive_rate = 8; + */ + protected $false_positive_rate = 0.0; + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + */ + protected $f1_score = 0.0; + /** + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * + * Generated from protobuf field float recall_at1 = 5; + */ + protected $recall_at1 = 0.0; + /** + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * + * Generated from protobuf field float precision_at1 = 6; + */ + protected $precision_at1 = 0.0; + /** + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * + * Generated from protobuf field float false_positive_rate_at1 = 9; + */ + protected $false_positive_rate_at1 = 0.0; + /** + * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + * + * Generated from protobuf field float f1_score_at1 = 7; + */ + protected $f1_score_at1 = 0.0; + /** + * Output only. The number of model created labels that match a ground truth + * label. + * + * Generated from protobuf field int64 true_positive_count = 10; + */ + protected $true_positive_count = 0; + /** + * Output only. The number of model created labels that do not match a + * ground truth label. + * + * Generated from protobuf field int64 false_positive_count = 11; + */ + protected $false_positive_count = 0; + /** + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * + * Generated from protobuf field int64 false_negative_count = 12; + */ + protected $false_negative_count = 0; + /** + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * + * Generated from protobuf field int64 true_negative_count = 13; + */ + protected $true_negative_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $confidence_threshold + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * @type int $position_threshold + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * @type float $recall + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * @type float $precision + * Output only. Precision for the given confidence threshold. + * @type float $false_positive_rate + * Output only. False Positive Rate for the given confidence threshold. + * @type float $f1_score + * Output only. The harmonic mean of recall and precision. + * @type float $recall_at1 + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * @type float $precision_at1 + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * @type float $false_positive_rate_at1 + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * @type float $f1_score_at1 + * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + * @type int|string $true_positive_count + * Output only. The number of model created labels that match a ground truth + * label. + * @type int|string $false_positive_count + * Output only. The number of model created labels that do not match a + * ground truth label. + * @type int|string $false_negative_count + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * @type int|string $true_negative_count + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * + * Generated from protobuf field float confidence_threshold = 1; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * + * Generated from protobuf field float confidence_threshold = 1; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * + * Generated from protobuf field int32 position_threshold = 14; + * @return int + */ + public function getPositionThreshold() + { + return $this->position_threshold; + } + + /** + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * + * Generated from protobuf field int32 position_threshold = 14; + * @param int $var + * @return $this + */ + public function setPositionThreshold($var) + { + GPBUtil::checkInt32($var); + $this->position_threshold = $var; + + return $this; + } + + /** + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * + * Generated from protobuf field float recall = 2; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + + /** + * Output only. Precision for the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Output only. Precision for the given confidence threshold. + * + * Generated from protobuf field float precision = 3; + * @param float $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkFloat($var); + $this->precision = $var; + + return $this; + } + + /** + * Output only. False Positive Rate for the given confidence threshold. + * + * Generated from protobuf field float false_positive_rate = 8; + * @return float + */ + public function getFalsePositiveRate() + { + return $this->false_positive_rate; + } + + /** + * Output only. False Positive Rate for the given confidence threshold. + * + * Generated from protobuf field float false_positive_rate = 8; + * @param float $var + * @return $this + */ + public function setFalsePositiveRate($var) + { + GPBUtil::checkFloat($var); + $this->false_positive_rate = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 4; + * @param float $var + * @return $this + */ + public function setF1Score($var) + { + GPBUtil::checkFloat($var); + $this->f1_score = $var; + + return $this; + } + + /** + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * + * Generated from protobuf field float recall_at1 = 5; + * @return float + */ + public function getRecallAt1() + { + return $this->recall_at1; + } + + /** + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * + * Generated from protobuf field float recall_at1 = 5; + * @param float $var + * @return $this + */ + public function setRecallAt1($var) + { + GPBUtil::checkFloat($var); + $this->recall_at1 = $var; + + return $this; + } + + /** + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * + * Generated from protobuf field float precision_at1 = 6; + * @return float + */ + public function getPrecisionAt1() + { + return $this->precision_at1; + } + + /** + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * + * Generated from protobuf field float precision_at1 = 6; + * @param float $var + * @return $this + */ + public function setPrecisionAt1($var) + { + GPBUtil::checkFloat($var); + $this->precision_at1 = $var; + + return $this; + } + + /** + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * + * Generated from protobuf field float false_positive_rate_at1 = 9; + * @return float + */ + public function getFalsePositiveRateAt1() + { + return $this->false_positive_rate_at1; + } + + /** + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * + * Generated from protobuf field float false_positive_rate_at1 = 9; + * @param float $var + * @return $this + */ + public function setFalsePositiveRateAt1($var) + { + GPBUtil::checkFloat($var); + $this->false_positive_rate_at1 = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + * + * Generated from protobuf field float f1_score_at1 = 7; + * @return float + */ + public function getF1ScoreAt1() + { + return $this->f1_score_at1; + } + + /** + * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + * + * Generated from protobuf field float f1_score_at1 = 7; + * @param float $var + * @return $this + */ + public function setF1ScoreAt1($var) + { + GPBUtil::checkFloat($var); + $this->f1_score_at1 = $var; + + return $this; + } + + /** + * Output only. The number of model created labels that match a ground truth + * label. + * + * Generated from protobuf field int64 true_positive_count = 10; + * @return int|string + */ + public function getTruePositiveCount() + { + return $this->true_positive_count; + } + + /** + * Output only. The number of model created labels that match a ground truth + * label. + * + * Generated from protobuf field int64 true_positive_count = 10; + * @param int|string $var + * @return $this + */ + public function setTruePositiveCount($var) + { + GPBUtil::checkInt64($var); + $this->true_positive_count = $var; + + return $this; + } + + /** + * Output only. The number of model created labels that do not match a + * ground truth label. + * + * Generated from protobuf field int64 false_positive_count = 11; + * @return int|string + */ + public function getFalsePositiveCount() + { + return $this->false_positive_count; + } + + /** + * Output only. The number of model created labels that do not match a + * ground truth label. + * + * Generated from protobuf field int64 false_positive_count = 11; + * @param int|string $var + * @return $this + */ + public function setFalsePositiveCount($var) + { + GPBUtil::checkInt64($var); + $this->false_positive_count = $var; + + return $this; + } + + /** + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * + * Generated from protobuf field int64 false_negative_count = 12; + * @return int|string + */ + public function getFalseNegativeCount() + { + return $this->false_negative_count; + } + + /** + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * + * Generated from protobuf field int64 false_negative_count = 12; + * @param int|string $var + * @return $this + */ + public function setFalseNegativeCount($var) + { + GPBUtil::checkInt64($var); + $this->false_negative_count = $var; + + return $this; + } + + /** + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * + * Generated from protobuf field int64 true_negative_count = 13; + * @return int|string + */ + public function getTrueNegativeCount() + { + return $this->true_negative_count; + } + + /** + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * + * Generated from protobuf field int64 true_negative_count = 13; + * @param int|string $var + * @return $this + */ + public function setTrueNegativeCount($var) + { + GPBUtil::checkInt64($var); + $this->true_negative_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfidenceMetricsEntry::class, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics_ConfidenceMetricsEntry::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix.php new file mode 100644 index 000000000000..7fb6ec327e28 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix.php @@ -0,0 +1,186 @@ +google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + */ +class ConfusionMatrix extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. IDs of the annotation specs used in the confusion matrix. + * For Tables CLASSIFICATION + * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + * only list of [annotation_spec_display_name-s][] is populated. + * + * Generated from protobuf field repeated string annotation_spec_id = 1; + */ + private $annotation_spec_id; + /** + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. For Tables + * CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + * distinct values of the target column at the moment of the model + * evaluation are populated here. + * + * Generated from protobuf field repeated string display_name = 3; + */ + private $display_name; + /** + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + */ + private $row; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $annotation_spec_id + * Output only. IDs of the annotation specs used in the confusion matrix. + * For Tables CLASSIFICATION + * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + * only list of [annotation_spec_display_name-s][] is populated. + * @type array|\Google\Protobuf\Internal\RepeatedField $display_name + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. For Tables + * CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + * distinct values of the target column at the moment of the model + * evaluation are populated here. + * @type array<\Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix\Row>|\Google\Protobuf\Internal\RepeatedField $row + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. IDs of the annotation specs used in the confusion matrix. + * For Tables CLASSIFICATION + * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + * only list of [annotation_spec_display_name-s][] is populated. + * + * Generated from protobuf field repeated string annotation_spec_id = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotationSpecId() + { + return $this->annotation_spec_id; + } + + /** + * Output only. IDs of the annotation specs used in the confusion matrix. + * For Tables CLASSIFICATION + * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + * only list of [annotation_spec_display_name-s][] is populated. + * + * Generated from protobuf field repeated string annotation_spec_id = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotationSpecId($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotation_spec_id = $arr; + + return $this; + } + + /** + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. For Tables + * CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + * distinct values of the target column at the moment of the model + * evaluation are populated here. + * + * Generated from protobuf field repeated string display_name = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. For Tables + * CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + * distinct values of the target column at the moment of the model + * evaluation are populated here. + * + * Generated from protobuf field repeated string display_name = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisplayName($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->display_name = $arr; + + return $this; + } + + /** + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRow() + { + return $this->row; + } + + /** + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2; + * @param array<\Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRow($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix\Row::class); + $this->row = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfusionMatrix::class, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics_ConfusionMatrix::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix/Row.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix/Row.php new file mode 100644 index 000000000000..3f433135f499 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationEvaluationMetrics/ConfusionMatrix/Row.php @@ -0,0 +1,82 @@ +google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + */ +class Row extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * + * Generated from protobuf field repeated int32 example_count = 1; + */ + private $example_count; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $example_count + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Classification::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * + * Generated from protobuf field repeated int32 example_count = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExampleCount() + { + return $this->example_count; + } + + /** + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + * + * Generated from protobuf field repeated int32 example_count = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExampleCount($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->example_count = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Row::class, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics_ConfusionMatrix_Row::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationType.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationType.php new file mode 100644 index 000000000000..71c2bab1d3c7 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ClassificationType.php @@ -0,0 +1,61 @@ +google.cloud.automl.v1.ClassificationType + */ +class ClassificationType +{ + /** + * An un-set value of this enum. + * + * Generated from protobuf enum CLASSIFICATION_TYPE_UNSPECIFIED = 0; + */ + const CLASSIFICATION_TYPE_UNSPECIFIED = 0; + /** + * At most one label is allowed per example. + * + * Generated from protobuf enum MULTICLASS = 1; + */ + const MULTICLASS = 1; + /** + * Multiple labels are allowed for one example. + * + * Generated from protobuf enum MULTILABEL = 2; + */ + const MULTILABEL = 2; + + private static $valueToName = [ + self::CLASSIFICATION_TYPE_UNSPECIFIED => 'CLASSIFICATION_TYPE_UNSPECIFIED', + self::MULTICLASS => 'MULTICLASS', + self::MULTILABEL => 'MULTILABEL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetOperationMetadata.php new file mode 100644 index 000000000000..ac49c13c1fc5 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.CreateDatasetOperationMetadata + */ +class CreateDatasetOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetRequest.php new file mode 100644 index 000000000000..104ad7be83e2 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateDatasetRequest.php @@ -0,0 +1,127 @@ +google.cloud.automl.v1.CreateDatasetRequest + */ +class CreateDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project to create the dataset for. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The dataset to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset = null; + + /** + * @param string $parent Required. The resource name of the project to create the dataset for. Please see + * {@see AutoMlClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\Dataset $dataset Required. The dataset to create. + * + * @return \Google\Cloud\AutoMl\V1\CreateDatasetRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AutoMl\V1\Dataset $dataset): self + { + return (new self()) + ->setParent($parent) + ->setDataset($dataset); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the project to create the dataset for. + * @type \Google\Cloud\AutoMl\V1\Dataset $dataset + * Required. The dataset to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project to create the dataset for. + * + * 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 project to create the dataset for. + * + * 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 dataset to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\Dataset|null + */ + public function getDataset() + { + return $this->dataset; + } + + public function hasDataset() + { + return isset($this->dataset); + } + + public function clearDataset() + { + unset($this->dataset); + } + + /** + * Required. The dataset to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\Dataset $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Dataset::class); + $this->dataset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelOperationMetadata.php new file mode 100644 index 000000000000..d02e428ca252 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.CreateModelOperationMetadata + */ +class CreateModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelRequest.php new file mode 100644 index 000000000000..982fdf52d1c9 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/CreateModelRequest.php @@ -0,0 +1,127 @@ +google.cloud.automl.v1.CreateModelRequest + */ +class CreateModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent project where the model is being created. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The model to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $model = null; + + /** + * @param string $parent Required. Resource name of the parent project where the model is being created. Please see + * {@see AutoMlClient::locationName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\Model $model Required. The model to create. + * + * @return \Google\Cloud\AutoMl\V1\CreateModelRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\AutoMl\V1\Model $model): self + { + return (new self()) + ->setParent($parent) + ->setModel($model); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent project where the model is being created. + * @type \Google\Cloud\AutoMl\V1\Model $model + * Required. The model to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent project where the model is being created. + * + * 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. Resource name of the parent project where the model is being created. + * + * 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 model to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\Model|null + */ + public function getModel() + { + return $this->model; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Required. The model to create. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\Model $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Model::class); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Dataset.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Dataset.php new file mode 100644 index 000000000000..2e8ecb216189 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Dataset.php @@ -0,0 +1,533 @@ +google.cloud.automl.v1.Dataset + */ +class Dataset extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the dataset. + * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the dataset to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * User-provided description of the dataset. The description can be up to + * 25000 characters long. + * + * Generated from protobuf field string description = 3; + */ + protected $description = ''; + /** + * Output only. The number of examples in the dataset. + * + * Generated from protobuf field int32 example_count = 21; + */ + protected $example_count = 0; + /** + * Output only. Timestamp when this dataset was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 14; + */ + protected $create_time = null; + /** + * Used to perform consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 17; + */ + protected $etag = ''; + /** + * Optional. The labels with user-defined metadata to organize your dataset. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), 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. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 39; + */ + private $labels; + protected $dataset_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TranslationDatasetMetadata $translation_dataset_metadata + * Metadata for a dataset used for translation. + * @type \Google\Cloud\AutoMl\V1\ImageClassificationDatasetMetadata $image_classification_dataset_metadata + * Metadata for a dataset used for image classification. + * @type \Google\Cloud\AutoMl\V1\TextClassificationDatasetMetadata $text_classification_dataset_metadata + * Metadata for a dataset used for text classification. + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionDatasetMetadata $image_object_detection_dataset_metadata + * Metadata for a dataset used for image object detection. + * @type \Google\Cloud\AutoMl\V1\TextExtractionDatasetMetadata $text_extraction_dataset_metadata + * Metadata for a dataset used for text extraction. + * @type \Google\Cloud\AutoMl\V1\TextSentimentDatasetMetadata $text_sentiment_dataset_metadata + * Metadata for a dataset used for text sentiment. + * @type string $name + * Output only. The resource name of the dataset. + * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + * @type string $display_name + * Required. The name of the dataset to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. + * @type string $description + * User-provided description of the dataset. The description can be up to + * 25000 characters long. + * @type int $example_count + * Output only. The number of examples in the dataset. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when this dataset was created. + * @type string $etag + * Used to perform consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels with user-defined metadata to organize your dataset. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), 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. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Dataset::initOnce(); + parent::__construct($data); + } + + /** + * Metadata for a dataset used for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * @return \Google\Cloud\AutoMl\V1\TranslationDatasetMetadata|null + */ + public function getTranslationDatasetMetadata() + { + return $this->readOneof(23); + } + + public function hasTranslationDatasetMetadata() + { + return $this->hasOneof(23); + } + + /** + * Metadata for a dataset used for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationDatasetMetadata translation_dataset_metadata = 23; + * @param \Google\Cloud\AutoMl\V1\TranslationDatasetMetadata $var + * @return $this + */ + public function setTranslationDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationDatasetMetadata::class); + $this->writeOneof(23, $var); + + return $this; + } + + /** + * Metadata for a dataset used for image classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * @return \Google\Cloud\AutoMl\V1\ImageClassificationDatasetMetadata|null + */ + public function getImageClassificationDatasetMetadata() + { + return $this->readOneof(24); + } + + public function hasImageClassificationDatasetMetadata() + { + return $this->hasOneof(24); + } + + /** + * Metadata for a dataset used for image classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + * @param \Google\Cloud\AutoMl\V1\ImageClassificationDatasetMetadata $var + * @return $this + */ + public function setImageClassificationDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageClassificationDatasetMetadata::class); + $this->writeOneof(24, $var); + + return $this; + } + + /** + * Metadata for a dataset used for text classification. + * + * Generated from protobuf field .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * @return \Google\Cloud\AutoMl\V1\TextClassificationDatasetMetadata|null + */ + public function getTextClassificationDatasetMetadata() + { + return $this->readOneof(25); + } + + public function hasTextClassificationDatasetMetadata() + { + return $this->hasOneof(25); + } + + /** + * Metadata for a dataset used for text classification. + * + * Generated from protobuf field .google.cloud.automl.v1.TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + * @param \Google\Cloud\AutoMl\V1\TextClassificationDatasetMetadata $var + * @return $this + */ + public function setTextClassificationDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextClassificationDatasetMetadata::class); + $this->writeOneof(25, $var); + + return $this; + } + + /** + * Metadata for a dataset used for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionDatasetMetadata|null + */ + public function getImageObjectDetectionDatasetMetadata() + { + return $this->readOneof(26); + } + + public function hasImageObjectDetectionDatasetMetadata() + { + return $this->hasOneof(26); + } + + /** + * Metadata for a dataset used for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionDatasetMetadata $var + * @return $this + */ + public function setImageObjectDetectionDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionDatasetMetadata::class); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * Metadata for a dataset used for text extraction. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * @return \Google\Cloud\AutoMl\V1\TextExtractionDatasetMetadata|null + */ + public function getTextExtractionDatasetMetadata() + { + return $this->readOneof(28); + } + + public function hasTextExtractionDatasetMetadata() + { + return $this->hasOneof(28); + } + + /** + * Metadata for a dataset used for text extraction. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + * @param \Google\Cloud\AutoMl\V1\TextExtractionDatasetMetadata $var + * @return $this + */ + public function setTextExtractionDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextExtractionDatasetMetadata::class); + $this->writeOneof(28, $var); + + return $this; + } + + /** + * Metadata for a dataset used for text sentiment. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * @return \Google\Cloud\AutoMl\V1\TextSentimentDatasetMetadata|null + */ + public function getTextSentimentDatasetMetadata() + { + return $this->readOneof(30); + } + + public function hasTextSentimentDatasetMetadata() + { + return $this->hasOneof(30); + } + + /** + * Metadata for a dataset used for text sentiment. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + * @param \Google\Cloud\AutoMl\V1\TextSentimentDatasetMetadata $var + * @return $this + */ + public function setTextSentimentDatasetMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSentimentDatasetMetadata::class); + $this->writeOneof(30, $var); + + return $this; + } + + /** + * Output only. The resource name of the dataset. + * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the dataset. + * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + * + * 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; + } + + /** + * Required. The name of the dataset to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the dataset to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. + * + * 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; + } + + /** + * User-provided description of the dataset. The description can be up to + * 25000 characters long. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User-provided description of the dataset. The description can be up to + * 25000 characters long. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The number of examples in the dataset. + * + * Generated from protobuf field int32 example_count = 21; + * @return int + */ + public function getExampleCount() + { + return $this->example_count; + } + + /** + * Output only. The number of examples in the dataset. + * + * Generated from protobuf field int32 example_count = 21; + * @param int $var + * @return $this + */ + public function setExampleCount($var) + { + GPBUtil::checkInt32($var); + $this->example_count = $var; + + return $this; + } + + /** + * Output only. Timestamp when this dataset was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 14; + * @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); + } + + /** + * Output only. Timestamp when this dataset was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 14; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Used to perform consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 17; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Used to perform consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 17; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. The labels with user-defined metadata to organize your dataset. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), 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. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 39; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels with user-defined metadata to organize your dataset. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), 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. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 39; + * @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; + } + + /** + * @return string + */ + public function getDatasetMetadata() + { + return $this->whichOneof("dataset_metadata"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteDatasetRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteDatasetRequest.php new file mode 100644 index 000000000000..51473a001c78 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteDatasetRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.DeleteDatasetRequest + */ +class DeleteDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the dataset to delete. + * + * 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 dataset to delete. Please see + * {@see AutoMlClient::datasetName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\DeleteDatasetRequest + * + * @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 dataset to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the dataset to delete. + * + * 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 dataset to delete. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteModelRequest.php new file mode 100644 index 000000000000..2a2b9a73b439 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteModelRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.DeleteModelRequest + */ +class DeleteModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model being deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the model being deleted. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\DeleteModelRequest + * + * @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. Resource name of the model being deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the model being 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. Resource name of the model being 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteOperationMetadata.php new file mode 100644 index 000000000000..9e8a8551ac12 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeleteOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.DeleteOperationMetadata + */ +class DeleteOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelOperationMetadata.php new file mode 100644 index 000000000000..a60fd7e79038 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.DeployModelOperationMetadata + */ +class DeployModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelRequest.php new file mode 100644 index 000000000000..40b54b870eaf --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DeployModelRequest.php @@ -0,0 +1,156 @@ +google.cloud.automl.v1.DeployModelRequest + */ +class DeployModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model to deploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + protected $model_deployment_metadata; + + /** + * @param string $name Required. Resource name of the model to deploy. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\DeployModelRequest + * + * @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\AutoMl\V1\ImageObjectDetectionModelDeploymentMetadata $image_object_detection_model_deployment_metadata + * Model deployment metadata specific to Image Object Detection. + * @type \Google\Cloud\AutoMl\V1\ImageClassificationModelDeploymentMetadata $image_classification_model_deployment_metadata + * Model deployment metadata specific to Image Classification. + * @type string $name + * Required. Resource name of the model to deploy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Model deployment metadata specific to Image Object Detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelDeploymentMetadata|null + */ + public function getImageObjectDetectionModelDeploymentMetadata() + { + return $this->readOneof(2); + } + + public function hasImageObjectDetectionModelDeploymentMetadata() + { + return $this->hasOneof(2); + } + + /** + * Model deployment metadata specific to Image Object Detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelDeploymentMetadata $var + * @return $this + */ + public function setImageObjectDetectionModelDeploymentMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelDeploymentMetadata::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Model deployment metadata specific to Image Classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * @return \Google\Cloud\AutoMl\V1\ImageClassificationModelDeploymentMetadata|null + */ + public function getImageClassificationModelDeploymentMetadata() + { + return $this->readOneof(4); + } + + public function hasImageClassificationModelDeploymentMetadata() + { + return $this->hasOneof(4); + } + + /** + * Model deployment metadata specific to Image Classification. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + * @param \Google\Cloud\AutoMl\V1\ImageClassificationModelDeploymentMetadata $var + * @return $this + */ + public function setImageClassificationModelDeploymentMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageClassificationModelDeploymentMetadata::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Required. Resource name of the model to deploy. + * + * 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. Resource name of the model to deploy. + * + * 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; + } + + /** + * @return string + */ + public function getModelDeploymentMetadata() + { + return $this->whichOneof("model_deployment_metadata"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document.php new file mode 100644 index 000000000000..1563d30be57b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document.php @@ -0,0 +1,237 @@ +google.cloud.automl.v1.Document + */ +class Document extends \Google\Protobuf\Internal\Message +{ + /** + * An input config specifying the content of the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + */ + protected $input_config = null; + /** + * The plain text version of this document. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet document_text = 2; + */ + protected $document_text = null; + /** + * Describes the layout of the document. + * Sorted by [page_number][]. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Document.Layout layout = 3; + */ + private $layout; + /** + * The dimensions of the page in the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + */ + protected $document_dimensions = null; + /** + * Number of pages in the document. + * + * Generated from protobuf field int32 page_count = 5; + */ + protected $page_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\DocumentInputConfig $input_config + * An input config specifying the content of the document. + * @type \Google\Cloud\AutoMl\V1\TextSnippet $document_text + * The plain text version of this document. + * @type array<\Google\Cloud\AutoMl\V1\Document\Layout>|\Google\Protobuf\Internal\RepeatedField $layout + * Describes the layout of the document. + * Sorted by [page_number][]. + * @type \Google\Cloud\AutoMl\V1\DocumentDimensions $document_dimensions + * The dimensions of the page in the document. + * @type int $page_count + * Number of pages in the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * An input config specifying the content of the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + * @return \Google\Cloud\AutoMl\V1\DocumentInputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * An input config specifying the content of the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentInputConfig input_config = 1; + * @param \Google\Cloud\AutoMl\V1\DocumentInputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DocumentInputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * The plain text version of this document. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet document_text = 2; + * @return \Google\Cloud\AutoMl\V1\TextSnippet|null + */ + public function getDocumentText() + { + return $this->document_text; + } + + public function hasDocumentText() + { + return isset($this->document_text); + } + + public function clearDocumentText() + { + unset($this->document_text); + } + + /** + * The plain text version of this document. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet document_text = 2; + * @param \Google\Cloud\AutoMl\V1\TextSnippet $var + * @return $this + */ + public function setDocumentText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSnippet::class); + $this->document_text = $var; + + return $this; + } + + /** + * Describes the layout of the document. + * Sorted by [page_number][]. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Document.Layout layout = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLayout() + { + return $this->layout; + } + + /** + * Describes the layout of the document. + * Sorted by [page_number][]. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Document.Layout layout = 3; + * @param array<\Google\Cloud\AutoMl\V1\Document\Layout>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLayout($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\Document\Layout::class); + $this->layout = $arr; + + return $this; + } + + /** + * The dimensions of the page in the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + * @return \Google\Cloud\AutoMl\V1\DocumentDimensions|null + */ + public function getDocumentDimensions() + { + return $this->document_dimensions; + } + + public function hasDocumentDimensions() + { + return isset($this->document_dimensions); + } + + public function clearDocumentDimensions() + { + unset($this->document_dimensions); + } + + /** + * The dimensions of the page in the document. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions document_dimensions = 4; + * @param \Google\Cloud\AutoMl\V1\DocumentDimensions $var + * @return $this + */ + public function setDocumentDimensions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DocumentDimensions::class); + $this->document_dimensions = $var; + + return $this; + } + + /** + * Number of pages in the document. + * + * Generated from protobuf field int32 page_count = 5; + * @return int + */ + public function getPageCount() + { + return $this->page_count; + } + + /** + * Number of pages in the document. + * + * Generated from protobuf field int32 page_count = 5; + * @param int $var + * @return $this + */ + public function setPageCount($var) + { + GPBUtil::checkInt32($var); + $this->page_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout.php new file mode 100644 index 000000000000..6543bf1767ed --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout.php @@ -0,0 +1,228 @@ +google.cloud.automl.v1.Document.Layout + */ +class Layout extends \Google\Protobuf\Internal\Message +{ + /** + * Text Segment that represents a segment in + * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 1; + */ + protected $text_segment = null; + /** + * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + * from 1. + * + * Generated from protobuf field int32 page_number = 2; + */ + protected $page_number = 0; + /** + * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + * Contains exactly 4 + * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + */ + protected $bounding_poly = null; + /** + * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + */ + protected $text_segment_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TextSegment $text_segment + * Text Segment that represents a segment in + * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + * @type int $page_number + * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + * from 1. + * @type \Google\Cloud\AutoMl\V1\BoundingPoly $bounding_poly + * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + * Contains exactly 4 + * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * @type int $text_segment_type + * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Text Segment that represents a segment in + * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 1; + * @return \Google\Cloud\AutoMl\V1\TextSegment|null + */ + public function getTextSegment() + { + return $this->text_segment; + } + + public function hasTextSegment() + { + return isset($this->text_segment); + } + + public function clearTextSegment() + { + unset($this->text_segment); + } + + /** + * Text Segment that represents a segment in + * [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 1; + * @param \Google\Cloud\AutoMl\V1\TextSegment $var + * @return $this + */ + public function setTextSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSegment::class); + $this->text_segment = $var; + + return $this; + } + + /** + * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + * from 1. + * + * Generated from protobuf field int32 page_number = 2; + * @return int + */ + public function getPageNumber() + { + return $this->page_number; + } + + /** + * Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + * from 1. + * + * Generated from protobuf field int32 page_number = 2; + * @param int $var + * @return $this + */ + public function setPageNumber($var) + { + GPBUtil::checkInt32($var); + $this->page_number = $var; + + return $this; + } + + /** + * The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + * Contains exactly 4 + * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + * @return \Google\Cloud\AutoMl\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 position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + * Contains exactly 4 + * [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_poly = 3; + * @param \Google\Cloud\AutoMl\V1\BoundingPoly $var + * @return $this + */ + public function setBoundingPoly($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BoundingPoly::class); + $this->bounding_poly = $var; + + return $this; + } + + /** + * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + * @return int + */ + public function getTextSegmentType() + { + return $this->text_segment_type; + } + + /** + * The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document.Layout.TextSegmentType text_segment_type = 4; + * @param int $var + * @return $this + */ + public function setTextSegmentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\Document\Layout\TextSegmentType::class); + $this->text_segment_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Layout::class, \Google\Cloud\AutoMl\V1\Document_Layout::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout/TextSegmentType.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout/TextSegmentType.php new file mode 100644 index 000000000000..26f6465c5713 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Document/Layout/TextSegmentType.php @@ -0,0 +1,123 @@ +google.cloud.automl.v1.Document.Layout.TextSegmentType + */ +class TextSegmentType +{ + /** + * Should not be used. + * + * Generated from protobuf enum TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + */ + const TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + /** + * The text segment is a token. e.g. word. + * + * Generated from protobuf enum TOKEN = 1; + */ + const TOKEN = 1; + /** + * The text segment is a paragraph. + * + * Generated from protobuf enum PARAGRAPH = 2; + */ + const PARAGRAPH = 2; + /** + * The text segment is a form field. + * + * Generated from protobuf enum FORM_FIELD = 3; + */ + const FORM_FIELD = 3; + /** + * The text segment is the name part of a form field. It will be treated + * as child of another FORM_FIELD TextSegment if its span is subspan of + * another TextSegment with type FORM_FIELD. + * + * Generated from protobuf enum FORM_FIELD_NAME = 4; + */ + const FORM_FIELD_NAME = 4; + /** + * The text segment is the text content part of a form field. It will be + * treated as child of another FORM_FIELD TextSegment if its span is + * subspan of another TextSegment with type FORM_FIELD. + * + * Generated from protobuf enum FORM_FIELD_CONTENTS = 5; + */ + const FORM_FIELD_CONTENTS = 5; + /** + * The text segment is a whole table, including headers, and all rows. + * + * Generated from protobuf enum TABLE = 6; + */ + const TABLE = 6; + /** + * The text segment is a table's headers. It will be treated as child of + * another TABLE TextSegment if its span is subspan of another TextSegment + * with type TABLE. + * + * Generated from protobuf enum TABLE_HEADER = 7; + */ + const TABLE_HEADER = 7; + /** + * The text segment is a row in table. It will be treated as child of + * another TABLE TextSegment if its span is subspan of another TextSegment + * with type TABLE. + * + * Generated from protobuf enum TABLE_ROW = 8; + */ + const TABLE_ROW = 8; + /** + * The text segment is a cell in table. It will be treated as child of + * another TABLE_ROW TextSegment if its span is subspan of another + * TextSegment with type TABLE_ROW. + * + * Generated from protobuf enum TABLE_CELL = 9; + */ + const TABLE_CELL = 9; + + private static $valueToName = [ + self::TEXT_SEGMENT_TYPE_UNSPECIFIED => 'TEXT_SEGMENT_TYPE_UNSPECIFIED', + self::TOKEN => 'TOKEN', + self::PARAGRAPH => 'PARAGRAPH', + self::FORM_FIELD => 'FORM_FIELD', + self::FORM_FIELD_NAME => 'FORM_FIELD_NAME', + self::FORM_FIELD_CONTENTS => 'FORM_FIELD_CONTENTS', + self::TABLE => 'TABLE', + self::TABLE_HEADER => 'TABLE_HEADER', + self::TABLE_ROW => 'TABLE_ROW', + self::TABLE_CELL => 'TABLE_CELL', + ]; + + 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(TextSegmentType::class, \Google\Cloud\AutoMl\V1\Document_Layout_TextSegmentType::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions.php new file mode 100644 index 000000000000..ec1a7850a858 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions.php @@ -0,0 +1,135 @@ +google.cloud.automl.v1.DocumentDimensions + */ +class DocumentDimensions extends \Google\Protobuf\Internal\Message +{ + /** + * Unit of the dimension. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + */ + protected $unit = 0; + /** + * Width value of the document, works together with the unit. + * + * Generated from protobuf field float width = 2; + */ + protected $width = 0.0; + /** + * Height value of the document, works together with the unit. + * + * Generated from protobuf field float height = 3; + */ + protected $height = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $unit + * Unit of the dimension. + * @type float $width + * Width value of the document, works together with the unit. + * @type float $height + * Height value of the document, works together with the unit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Unit of the dimension. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + * @return int + */ + public function getUnit() + { + return $this->unit; + } + + /** + * Unit of the dimension. + * + * Generated from protobuf field .google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit unit = 1; + * @param int $var + * @return $this + */ + public function setUnit($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\DocumentDimensions\DocumentDimensionUnit::class); + $this->unit = $var; + + return $this; + } + + /** + * Width value of the document, works together with the unit. + * + * Generated from protobuf field float width = 2; + * @return float + */ + public function getWidth() + { + return $this->width; + } + + /** + * Width value of the document, works together with the unit. + * + * Generated from protobuf field float width = 2; + * @param float $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkFloat($var); + $this->width = $var; + + return $this; + } + + /** + * Height value of the document, works together with the unit. + * + * Generated from protobuf field float height = 3; + * @return float + */ + public function getHeight() + { + return $this->height; + } + + /** + * Height value of the document, works together with the unit. + * + * Generated from protobuf field float height = 3; + * @param float $var + * @return $this + */ + public function setHeight($var) + { + GPBUtil::checkFloat($var); + $this->height = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions/DocumentDimensionUnit.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions/DocumentDimensionUnit.php new file mode 100644 index 000000000000..2faca889037c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentDimensions/DocumentDimensionUnit.php @@ -0,0 +1,71 @@ +google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit + */ +class DocumentDimensionUnit +{ + /** + * Should not be used. + * + * Generated from protobuf enum DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + */ + const DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + /** + * Document dimension is measured in inches. + * + * Generated from protobuf enum INCH = 1; + */ + const INCH = 1; + /** + * Document dimension is measured in centimeters. + * + * Generated from protobuf enum CENTIMETER = 2; + */ + const CENTIMETER = 2; + /** + * Document dimension is measured in points. 72 points = 1 inch. + * + * Generated from protobuf enum POINT = 3; + */ + const POINT = 3; + + private static $valueToName = [ + self::DOCUMENT_DIMENSION_UNIT_UNSPECIFIED => 'DOCUMENT_DIMENSION_UNIT_UNSPECIFIED', + self::INCH => 'INCH', + self::CENTIMETER => 'CENTIMETER', + self::POINT => 'POINT', + ]; + + 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(DocumentDimensionUnit::class, \Google\Cloud\AutoMl\V1\DocumentDimensions_DocumentDimensionUnit::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentInputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentInputConfig.php new file mode 100644 index 000000000000..6c4eeee9e78d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/DocumentInputConfig.php @@ -0,0 +1,89 @@ +google.cloud.automl.v1.DocumentInputConfig + */ +class DocumentInputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * Max supported size: 512MB. + * Supported extensions: .PDF. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + */ + protected $gcs_source = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsSource $gcs_source + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * Max supported size: 512MB. + * Supported extensions: .PDF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * Max supported size: 512MB. + * Supported extensions: .PDF. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + * @return \Google\Cloud\AutoMl\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->gcs_source; + } + + public function hasGcsSource() + { + return isset($this->gcs_source); + } + + public function clearGcsSource() + { + unset($this->gcs_source); + } + + /** + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * Max supported size: 512MB. + * Supported extensions: .PDF. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + * @param \Google\Cloud\AutoMl\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsSource::class); + $this->gcs_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExamplePayload.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExamplePayload.php new file mode 100644 index 000000000000..9348c79ee7f3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExamplePayload.php @@ -0,0 +1,141 @@ +google.cloud.automl.v1.ExamplePayload + */ +class ExamplePayload extends \Google\Protobuf\Internal\Message +{ + protected $payload; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\Image $image + * Example image. + * @type \Google\Cloud\AutoMl\V1\TextSnippet $text_snippet + * Example text. + * @type \Google\Cloud\AutoMl\V1\Document $document + * Example document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Example image. + * + * Generated from protobuf field .google.cloud.automl.v1.Image image = 1; + * @return \Google\Cloud\AutoMl\V1\Image|null + */ + public function getImage() + { + return $this->readOneof(1); + } + + public function hasImage() + { + return $this->hasOneof(1); + } + + /** + * Example image. + * + * Generated from protobuf field .google.cloud.automl.v1.Image image = 1; + * @param \Google\Cloud\AutoMl\V1\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Image::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Example text. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet text_snippet = 2; + * @return \Google\Cloud\AutoMl\V1\TextSnippet|null + */ + public function getTextSnippet() + { + return $this->readOneof(2); + } + + public function hasTextSnippet() + { + return $this->hasOneof(2); + } + + /** + * Example text. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet text_snippet = 2; + * @param \Google\Cloud\AutoMl\V1\TextSnippet $var + * @return $this + */ + public function setTextSnippet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSnippet::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Example document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document document = 4; + * @return \Google\Cloud\AutoMl\V1\Document|null + */ + public function getDocument() + { + return $this->readOneof(4); + } + + public function hasDocument() + { + return $this->hasOneof(4); + } + + /** + * Example document. + * + * Generated from protobuf field .google.cloud.automl.v1.Document document = 4; + * @param \Google\Cloud\AutoMl\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Document::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getPayload() + { + return $this->whichOneof("payload"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata.php new file mode 100644 index 000000000000..df21bee419e0 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata.php @@ -0,0 +1,77 @@ +google.cloud.automl.v1.ExportDataOperationMetadata + */ +class ExportDataOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Information further describing this export data's output. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + */ + protected $output_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata\ExportDataOutputInfo $output_info + * Output only. Information further describing this export data's output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Information further describing this export data's output. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * @return \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata\ExportDataOutputInfo|null + */ + public function getOutputInfo() + { + return $this->output_info; + } + + public function hasOutputInfo() + { + return isset($this->output_info); + } + + public function clearOutputInfo() + { + unset($this->output_info); + } + + /** + * Output only. Information further describing this export data's output. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo output_info = 1; + * @param \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata\ExportDataOutputInfo $var + * @return $this + */ + public function setOutputInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata\ExportDataOutputInfo::class); + $this->output_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata/ExportDataOutputInfo.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata/ExportDataOutputInfo.php new file mode 100644 index 000000000000..9b2842faa5b7 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataOperationMetadata/ExportDataOutputInfo.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + */ +class ExportDataOutputInfo extends \Google\Protobuf\Internal\Message +{ + protected $output_location; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_output_directory + * The full path of the Google Cloud Storage directory created, into which + * the exported data is written. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the exported data is written. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @return string + */ + public function getGcsOutputDirectory() + { + return $this->readOneof(1); + } + + public function hasGcsOutputDirectory() + { + return $this->hasOneof(1); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the exported data is written. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @param string $var + * @return $this + */ + public function setGcsOutputDirectory($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getOutputLocation() + { + return $this->whichOneof("output_location"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ExportDataOutputInfo::class, \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata_ExportDataOutputInfo::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataRequest.php new file mode 100644 index 000000000000..de1805283889 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportDataRequest.php @@ -0,0 +1,127 @@ +google.cloud.automl.v1.ExportDataRequest + */ +class ExportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the dataset. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The desired output location. + * + * Generated from protobuf field .google.cloud.automl.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + + /** + * @param string $name Required. The resource name of the dataset. Please see + * {@see AutoMlClient::datasetName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\OutputConfig $outputConfig Required. The desired output location. + * + * @return \Google\Cloud\AutoMl\V1\ExportDataRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\OutputConfig $outputConfig): self + { + return (new self()) + ->setName($name) + ->setOutputConfig($outputConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the dataset. + * @type \Google\Cloud\AutoMl\V1\OutputConfig $output_config + * Required. The desired output location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the dataset. + * + * 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 dataset. + * + * 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; + } + + /** + * Required. The desired output location. + * + * Generated from protobuf field .google.cloud.automl.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\OutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The desired output location. + * + * Generated from protobuf field .google.cloud.automl.v1.OutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\OutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\OutputConfig::class); + $this->output_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata.php new file mode 100644 index 000000000000..d14c8c23cdf4 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.ExportModelOperationMetadata + */ +class ExportModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Information further describing the output of this model + * export. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + */ + protected $output_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata\ExportModelOutputInfo $output_info + * Output only. Information further describing the output of this model + * export. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Information further describing the output of this model + * export. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * @return \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata\ExportModelOutputInfo|null + */ + public function getOutputInfo() + { + return $this->output_info; + } + + public function hasOutputInfo() + { + return isset($this->output_info); + } + + public function clearOutputInfo() + { + unset($this->output_info); + } + + /** + * Output only. Information further describing the output of this model + * export. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo output_info = 2; + * @param \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata\ExportModelOutputInfo $var + * @return $this + */ + public function setOutputInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata\ExportModelOutputInfo::class); + $this->output_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata/ExportModelOutputInfo.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata/ExportModelOutputInfo.php new file mode 100644 index 000000000000..a474a71bfbcd --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelOperationMetadata/ExportModelOutputInfo.php @@ -0,0 +1,76 @@ +google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + */ +class ExportModelOutputInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The full path of the Google Cloud Storage directory created, into which + * the model will be exported. + * + * Generated from protobuf field string gcs_output_directory = 1; + */ + protected $gcs_output_directory = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_output_directory + * The full path of the Google Cloud Storage directory created, into which + * the model will be exported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the model will be exported. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @return string + */ + public function getGcsOutputDirectory() + { + return $this->gcs_output_directory; + } + + /** + * The full path of the Google Cloud Storage directory created, into which + * the model will be exported. + * + * Generated from protobuf field string gcs_output_directory = 1; + * @param string $var + * @return $this + */ + public function setGcsOutputDirectory($var) + { + GPBUtil::checkString($var, True); + $this->gcs_output_directory = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ExportModelOutputInfo::class, \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata_ExportModelOutputInfo::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelRequest.php new file mode 100644 index 000000000000..f312fb2a3331 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ExportModelRequest.php @@ -0,0 +1,129 @@ +google.cloud.automl.v1.ExportModelRequest + */ +class ExportModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the model to export. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The desired output location and configuration. + * + * Generated from protobuf field .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_config = null; + + /** + * @param string $name Required. The resource name of the model to export. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\ModelExportOutputConfig $outputConfig Required. The desired output location and configuration. + * + * @return \Google\Cloud\AutoMl\V1\ExportModelRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\ModelExportOutputConfig $outputConfig): self + { + return (new self()) + ->setName($name) + ->setOutputConfig($outputConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the model to export. + * @type \Google\Cloud\AutoMl\V1\ModelExportOutputConfig $output_config + * Required. The desired output location and configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the model to export. + * + * 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 model to export. + * + * 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; + } + + /** + * Required. The desired output location and configuration. + * + * Generated from protobuf field .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\ModelExportOutputConfig|null + */ + public function getOutputConfig() + { + return $this->output_config; + } + + public function hasOutputConfig() + { + return isset($this->output_config); + } + + public function clearOutputConfig() + { + unset($this->output_config); + } + + /** + * Required. The desired output location and configuration. + * + * Generated from protobuf field .google.cloud.automl.v1.ModelExportOutputConfig output_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\ModelExportOutputConfig $var + * @return $this + */ + public function setOutputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ModelExportOutputConfig::class); + $this->output_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsDestination.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsDestination.php new file mode 100644 index 000000000000..1507ee3b65c3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsDestination.php @@ -0,0 +1,87 @@ +google.cloud.automl.v1.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URI to output directory, up to 2000 + * characters long. + * Accepted forms: + * * Prefix path: gs://bucket/directory + * The requesting user must have write permission to the bucket. + * The directory is created if it doesn't exist. + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_uri_prefix = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $output_uri_prefix + * Required. Google Cloud Storage URI to output directory, up to 2000 + * characters long. + * Accepted forms: + * * Prefix path: gs://bucket/directory + * The requesting user must have write permission to the bucket. + * The directory is created if it doesn't exist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URI to output directory, up to 2000 + * characters long. + * Accepted forms: + * * Prefix path: gs://bucket/directory + * The requesting user must have write permission to the bucket. + * The directory is created if it doesn't exist. + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOutputUriPrefix() + { + return $this->output_uri_prefix; + } + + /** + * Required. Google Cloud Storage URI to output directory, up to 2000 + * characters long. + * Accepted forms: + * * Prefix path: gs://bucket/directory + * The requesting user must have write permission to the bucket. + * The directory is created if it doesn't exist. + * + * Generated from protobuf field string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOutputUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->output_uri_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsSource.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsSource.php new file mode 100644 index 000000000000..f1ee2813c293 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GcsSource.php @@ -0,0 +1,75 @@ +google.cloud.automl.v1.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: + * * Full object path, e.g. gs://bucket/directory/object.csv + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $input_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $input_uris + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: + * * Full object path, e.g. gs://bucket/directory/object.csv + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: + * * Full object path, e.g. gs://bucket/directory/object.csv + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInputUris() + { + return $this->input_uris; + } + + /** + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: + * * Full object path, e.g. gs://bucket/directory/object.csv + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInputUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->input_uris = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetAnnotationSpecRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetAnnotationSpecRequest.php new file mode 100644 index 000000000000..b6537a7c5566 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetAnnotationSpecRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.GetAnnotationSpecRequest + */ +class GetAnnotationSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the annotation spec to retrieve. + * + * 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 annotation spec to retrieve. Please see + * {@see AutoMlClient::annotationSpecName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\GetAnnotationSpecRequest + * + * @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 annotation spec to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the annotation spec to retrieve. + * + * 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 annotation spec to retrieve. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetDatasetRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetDatasetRequest.php new file mode 100644 index 000000000000..e72ac9b107a3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetDatasetRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.GetDatasetRequest + */ +class GetDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the dataset to retrieve. + * + * 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 dataset to retrieve. Please see + * {@see AutoMlClient::datasetName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\GetDatasetRequest + * + * @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 dataset to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the dataset to retrieve. + * + * 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 dataset to retrieve. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelEvaluationRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelEvaluationRequest.php new file mode 100644 index 000000000000..486af4fea40c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelEvaluationRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.GetModelEvaluationRequest + */ +class GetModelEvaluationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name for the model evaluation. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name for the model evaluation. Please see + * {@see AutoMlClient::modelEvaluationName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\GetModelEvaluationRequest + * + * @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. Resource name for the model evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name for the model 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. Resource name for the model 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelRequest.php new file mode 100644 index 000000000000..a318754dbc1a --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/GetModelRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.GetModelRequest + */ +class GetModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the model. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\GetModelRequest + * + * @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. Resource name of the model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the model. + * + * 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. Resource name of the model. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Image.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Image.php new file mode 100644 index 000000000000..e419a45e3363 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Image.php @@ -0,0 +1,116 @@ +google.cloud.automl.v1.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. HTTP URI to the thumbnail image. + * + * Generated from protobuf field string thumbnail_uri = 4; + */ + protected $thumbnail_uri = ''; + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_bytes + * Image 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 $thumbnail_uri + * Output only. HTTP URI to the thumbnail image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Image 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 image_bytes = 1; + * @return string + */ + public function getImageBytes() + { + return $this->readOneof(1); + } + + public function hasImageBytes() + { + return $this->hasOneof(1); + } + + /** + * Image 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 image_bytes = 1; + * @param string $var + * @return $this + */ + public function setImageBytes($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Output only. HTTP URI to the thumbnail image. + * + * Generated from protobuf field string thumbnail_uri = 4; + * @return string + */ + public function getThumbnailUri() + { + return $this->thumbnail_uri; + } + + /** + * Output only. HTTP URI to the thumbnail image. + * + * Generated from protobuf field string thumbnail_uri = 4; + * @param string $var + * @return $this + */ + public function setThumbnailUri($var) + { + GPBUtil::checkString($var, True); + $this->thumbnail_uri = $var; + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationDatasetMetadata.php new file mode 100644 index 000000000000..cdff5eb4abcc --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationDatasetMetadata.php @@ -0,0 +1,67 @@ +google.cloud.automl.v1.ImageClassificationDatasetMetadata + */ +class ImageClassificationDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $classification_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $classification_type + * Required. Type of the classification problem. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getClassificationType() + { + return $this->classification_type; + } + + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setClassificationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\ClassificationType::class); + $this->classification_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelDeploymentMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelDeploymentMetadata.php new file mode 100644 index 000000000000..6feef139228c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelDeploymentMetadata.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + */ +class ImageClassificationModelDeploymentMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $node_count + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + * Must be between 1 and 100, inclusive on both ends. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return int|string + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->node_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelMetadata.php new file mode 100644 index 000000000000..9ae527709873 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageClassificationModelMetadata.php @@ -0,0 +1,491 @@ +google.cloud.automl.v1.ImageClassificationModelMetadata + */ +class ImageClassificationModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * + * Generated from protobuf field string base_model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $base_model_id = ''; + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $train_budget_milli_node_hours = 0; + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $train_cost_milli_node_hours = 0; + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stop_reason = ''; + /** + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. Expected to have low latency, but may have + * lower prediction quality than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + * Core ML afterwards. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * + * Generated from protobuf field string model_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_type = ''; + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_qps = 0.0; + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * + * Generated from protobuf field int64 node_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $base_model_id + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * @type int|string $train_budget_milli_node_hours + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * @type int|string $train_cost_milli_node_hours + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * @type string $stop_reason + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * @type string $model_type + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. Expected to have low latency, but may have + * lower prediction quality than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + * Core ML afterwards. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * @type float $node_qps + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * @type int|string $node_count + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * + * Generated from protobuf field string base_model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBaseModelId() + { + return $this->base_model_id; + } + + /** + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * + * Generated from protobuf field string base_model_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBaseModelId($var) + { + GPBUtil::checkString($var, True); + $this->base_model_id = $var; + + return $this; + } + + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getTrainBudgetMilliNodeHours() + { + return $this->train_budget_milli_node_hours; + } + + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setTrainBudgetMilliNodeHours($var) + { + GPBUtil::checkInt64($var); + $this->train_budget_milli_node_hours = $var; + + return $this; + } + + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTrainCostMilliNodeHours() + { + return $this->train_cost_milli_node_hours; + } + + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTrainCostMilliNodeHours($var) + { + GPBUtil::checkInt64($var); + $this->train_cost_milli_node_hours = $var; + + return $this; + } + + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStopReason() + { + return $this->stop_reason; + } + + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStopReason($var) + { + GPBUtil::checkString($var, True); + $this->stop_reason = $var; + + return $this; + } + + /** + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. Expected to have low latency, but may have + * lower prediction quality than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + * Core ML afterwards. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * + * Generated from protobuf field string model_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getModelType() + { + return $this->model_type; + } + + /** + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. Expected to have low latency, but may have + * lower prediction quality than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + * ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + * Core ML afterwards. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * + * Generated from protobuf field string model_type = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setModelType($var) + { + GPBUtil::checkString($var, True); + $this->model_type = $var; + + return $this; + } + + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getNodeQps() + { + return $this->node_qps; + } + + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setNodeQps($var) + { + GPBUtil::checkDouble($var); + $this->node_qps = $var; + + return $this; + } + + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * + * Generated from protobuf field int64 node_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * + * Generated from protobuf field int64 node_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->node_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionAnnotation.php new file mode 100644 index 000000000000..d14e42e9405c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionAnnotation.php @@ -0,0 +1,115 @@ +google.cloud.automl.v1.ImageObjectDetectionAnnotation + */ +class ImageObjectDetectionAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The rectangle representing the object location. + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + */ + protected $bounding_box = null; + /** + * Output only. The confidence that this annotation is positive for the parent example, + * value in [0, 1], higher means higher positivity confidence. + * + * Generated from protobuf field float score = 2; + */ + protected $score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\BoundingPoly $bounding_box + * Output only. The rectangle representing the object location. + * @type float $score + * Output only. The confidence that this annotation is positive for the parent example, + * value in [0, 1], higher means higher positivity confidence. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Detection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The rectangle representing the object location. + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + * @return \Google\Cloud\AutoMl\V1\BoundingPoly|null + */ + public function getBoundingBox() + { + return $this->bounding_box; + } + + public function hasBoundingBox() + { + return isset($this->bounding_box); + } + + public function clearBoundingBox() + { + unset($this->bounding_box); + } + + /** + * Output only. The rectangle representing the object location. + * + * Generated from protobuf field .google.cloud.automl.v1.BoundingPoly bounding_box = 1; + * @param \Google\Cloud\AutoMl\V1\BoundingPoly $var + * @return $this + */ + public function setBoundingBox($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BoundingPoly::class); + $this->bounding_box = $var; + + return $this; + } + + /** + * Output only. The confidence that this annotation is positive for the parent example, + * value in [0, 1], higher means higher positivity confidence. + * + * Generated from protobuf field float score = 2; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Output only. The confidence that this annotation is positive for the parent example, + * value in [0, 1], higher means higher positivity confidence. + * + * Generated from protobuf field float score = 2; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionDatasetMetadata.php new file mode 100644 index 000000000000..a2ba5e2adecf --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionDatasetMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + */ +class ImageObjectDetectionDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionEvaluationMetrics.php new file mode 100644 index 000000000000..c76660d7f663 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionEvaluationMetrics.php @@ -0,0 +1,156 @@ +google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + */ +class ImageObjectDetectionEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * + * Generated from protobuf field int32 evaluated_bounding_box_count = 1; + */ + protected $evaluated_bounding_box_count = 0; + /** + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + */ + private $bounding_box_metrics_entries; + /** + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * + * Generated from protobuf field float bounding_box_mean_average_precision = 3; + */ + protected $bounding_box_mean_average_precision = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $evaluated_bounding_box_count + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * @type array<\Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $bounding_box_metrics_entries + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * @type float $bounding_box_mean_average_precision + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Detection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * + * Generated from protobuf field int32 evaluated_bounding_box_count = 1; + * @return int + */ + public function getEvaluatedBoundingBoxCount() + { + return $this->evaluated_bounding_box_count; + } + + /** + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * + * Generated from protobuf field int32 evaluated_bounding_box_count = 1; + * @param int $var + * @return $this + */ + public function setEvaluatedBoundingBoxCount($var) + { + GPBUtil::checkInt32($var); + $this->evaluated_bounding_box_count = $var; + + return $this; + } + + /** + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBoundingBoxMetricsEntries() + { + return $this->bounding_box_metrics_entries; + } + + /** + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + * @param array<\Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBoundingBoxMetricsEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\BoundingBoxMetricsEntry::class); + $this->bounding_box_metrics_entries = $arr; + + return $this; + } + + /** + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * + * Generated from protobuf field float bounding_box_mean_average_precision = 3; + * @return float + */ + public function getBoundingBoxMeanAveragePrecision() + { + return $this->bounding_box_mean_average_precision; + } + + /** + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * + * Generated from protobuf field float bounding_box_mean_average_precision = 3; + * @param float $var + * @return $this + */ + public function setBoundingBoxMeanAveragePrecision($var) + { + GPBUtil::checkFloat($var); + $this->bounding_box_mean_average_precision = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelDeploymentMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelDeploymentMetadata.php new file mode 100644 index 000000000000..aa2ba7040637 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelDeploymentMetadata.php @@ -0,0 +1,83 @@ +google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + */ +class ImageObjectDetectionModelDeploymentMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $node_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $node_count + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + * Must be between 1 and 100, inclusive on both ends. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return int|string + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + * Must be between 1 and 100, inclusive on both ends. + * + * Generated from protobuf field int64 node_count = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->node_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelMetadata.php new file mode 100644 index 000000000000..522fb87ccb8f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImageObjectDetectionModelMetadata.php @@ -0,0 +1,405 @@ +google.cloud.automl.v1.ImageObjectDetectionModelMetadata + */ +class ImageObjectDetectionModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * + * Generated from protobuf field string model_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model_type = ''; + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * + * Generated from protobuf field int64 node_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_count = 0; + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $node_qps = 0.0; + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stop_reason = ''; + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $train_budget_milli_node_hours = 0; + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $train_cost_milli_node_hours = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model_type + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * @type int|string $node_count + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * @type float $node_qps + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * @type string $stop_reason + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * @type int|string $train_budget_milli_node_hours + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * @type int|string $train_cost_milli_node_hours + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Image::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * + * Generated from protobuf field string model_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getModelType() + { + return $this->model_type; + } + + /** + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have low latency, but + * may have lower prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + * with TensorFlow afterwards. Expected to have a higher + * latency, but should also have a higher prediction quality + * than other models. + * + * Generated from protobuf field string model_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setModelType($var) + { + GPBUtil::checkString($var, True); + $this->model_type = $var; + + return $this; + } + + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * + * Generated from protobuf field int64 node_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getNodeCount() + { + return $this->node_count; + } + + /** + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * + * Generated from protobuf field int64 node_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt64($var); + $this->node_count = $var; + + return $this; + } + + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getNodeQps() + { + return $this->node_qps; + } + + /** + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * Generated from protobuf field double node_qps = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setNodeQps($var) + { + GPBUtil::checkDouble($var); + $this->node_qps = $var; + + return $this; + } + + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStopReason() + { + return $this->stop_reason; + } + + /** + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * Generated from protobuf field string stop_reason = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStopReason($var) + { + GPBUtil::checkString($var, True); + $this->stop_reason = $var; + + return $this; + } + + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getTrainBudgetMilliNodeHours() + { + return $this->train_budget_milli_node_hours; + } + + /** + * Optional. The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * + * Generated from protobuf field int64 train_budget_milli_node_hours = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setTrainBudgetMilliNodeHours($var) + { + GPBUtil::checkInt64($var); + $this->train_budget_milli_node_hours = $var; + + return $this; + } + + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTrainCostMilliNodeHours() + { + return $this->train_cost_milli_node_hours; + } + + /** + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * Generated from protobuf field int64 train_cost_milli_node_hours = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTrainCostMilliNodeHours($var) + { + GPBUtil::checkInt64($var); + $this->train_cost_milli_node_hours = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataOperationMetadata.php new file mode 100644 index 000000000000..33f3202cd1f0 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.ImportDataOperationMetadata + */ +class ImportDataOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataRequest.php new file mode 100644 index 000000000000..c8b094af5d22 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ImportDataRequest.php @@ -0,0 +1,137 @@ +google.cloud.automl.v1.ImportDataRequest + */ +class ImportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The desired input location and its domain specific semantics, + * if any. + * + * Generated from protobuf field .google.cloud.automl.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + + /** + * @param string $name Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. Please see + * {@see AutoMlClient::datasetName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\InputConfig $inputConfig Required. The desired input location and its domain specific semantics, + * if any. + * + * @return \Google\Cloud\AutoMl\V1\ImportDataRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\InputConfig $inputConfig): self + { + return (new self()) + ->setName($name) + ->setInputConfig($inputConfig); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * @type \Google\Cloud\AutoMl\V1\InputConfig $input_config + * Required. The desired input location and its domain specific semantics, + * if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * + * 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. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * + * 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; + } + + /** + * Required. The desired input location and its domain specific semantics, + * if any. + * + * Generated from protobuf field .google.cloud.automl.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. The desired input location and its domain specific semantics, + * if any. + * + * Generated from protobuf field .google.cloud.automl.v1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\InputConfig::class); + $this->input_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/InputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/InputConfig.php new file mode 100644 index 000000000000..eb2d04bbb9c0 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/InputConfig.php @@ -0,0 +1,614 @@ + + * + * #### AutoML Video Intelligence + * ##### Classification + * See [Preparing your training + * data](https://cloud.google.com/video-intelligence/automl/docs/prepare) for + * more information. + * CSV file(s) with each line in format: + * ML_USE,GCS_FILE_PATH + * For `ML_USE`, do not use `VALIDATE`. + * `GCS_FILE_PATH` is the path to another .csv file that describes training + * example for a given `ML_USE`, using the following row format: + * GCS_FILE_PATH,(LABEL,TIME_SEGMENT_START,TIME_SEGMENT_END | ,,) + * Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up + * to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. + * `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the + * length of the video, and the end time must be after the start time. Any + * segment of a video which has one or more labels on it, is considered a + * hard negative for all other labels. Any segment with no labels on + * it is considered to be unknown. If a whole video is unknown, then + * it should be mentioned just once with ",," in place of `LABEL, + * TIME_SEGMENT_START,TIME_SEGMENT_END`. + * Sample top level CSV file: + * TRAIN,gs://folder/train_videos.csv + * TEST,gs://folder/test_videos.csv + * UNASSIGNED,gs://folder/other_videos.csv + * Sample rows of a CSV file for a particular ML_USE: + * gs://folder/video1.avi,car,120,180.000021 + * gs://folder/video1.avi,bike,150,180.000021 + * gs://folder/vid2.avi,car,0,60.5 + * gs://folder/vid3.avi,,, + * ##### Object Tracking + * See [Preparing your training + * data](/video-intelligence/automl/object-tracking/docs/prepare) for more + * information. + * CSV file(s) with each line in format: + * ML_USE,GCS_FILE_PATH + * For `ML_USE`, do not use `VALIDATE`. + * `GCS_FILE_PATH` is the path to another .csv file that describes training + * example for a given `ML_USE`, using the following row format: + * GCS_FILE_PATH,LABEL,[INSTANCE_ID],TIMESTAMP,BOUNDING_BOX + * or + * GCS_FILE_PATH,,,,,,,,,, + * Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up + * to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. + * Providing `INSTANCE_ID`s can help to obtain a better model. When + * a specific labeled entity leaves the video frame, and shows up + * afterwards it is not required, albeit preferable, that the same + * `INSTANCE_ID` is given to it. + * `TIMESTAMP` must be within the length of the video, the + * `BOUNDING_BOX` is assumed to be drawn on the closest video's frame + * to the `TIMESTAMP`. Any mentioned by the `TIMESTAMP` frame is expected + * to be exhaustively labeled and no more than 500 `BOUNDING_BOX`-es per + * frame are allowed. If a whole video is unknown, then it should be + * mentioned just once with ",,,,,,,,,," in place of `LABEL, + * [INSTANCE_ID],TIMESTAMP,BOUNDING_BOX`. + * Sample top level CSV file: + * TRAIN,gs://folder/train_videos.csv + * TEST,gs://folder/test_videos.csv + * UNASSIGNED,gs://folder/other_videos.csv + * Seven sample rows of a CSV file for a particular ML_USE: + * gs://folder/video1.avi,car,1,12.10,0.8,0.8,0.9,0.8,0.9,0.9,0.8,0.9 + * gs://folder/video1.avi,car,1,12.90,0.4,0.8,0.5,0.8,0.5,0.9,0.4,0.9 + * gs://folder/video1.avi,car,2,12.10,.4,.2,.5,.2,.5,.3,.4,.3 + * gs://folder/video1.avi,car,2,12.90,.8,.2,,,.9,.3,, + * gs://folder/video1.avi,bike,,12.50,.45,.45,,,.55,.55,, + * gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, + * gs://folder/video2.avi,,,,,,,,,,, + * #### AutoML Natural Language + * ##### Entity Extraction + * See [Preparing your training + * data](/natural-language/automl/entity-analysis/docs/prepare) for more + * information. + * One or more CSV file(s) with each line in the following format: + * ML_USE,GCS_FILE_PATH + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing.. + * * `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in + * Google Cloud Storage that contains in-line text in-line as documents + * for model training. + * After the training data set has been determined from the `TRAIN` and + * `UNASSIGNED` CSV files, the training data is divided into train and + * validation data sets. 70% for training and 30% for validation. + * For example: + * TRAIN,gs://folder/file1.jsonl + * VALIDATE,gs://folder/file2.jsonl + * TEST,gs://folder/file3.jsonl + * **In-line JSONL files** + * In-line .JSONL files contain, per line, a JSON document that wraps a + * [`text_snippet`][google.cloud.automl.v1.TextSnippet] field followed by + * one or more [`annotations`][google.cloud.automl.v1.AnnotationPayload] + * fields, which have `display_name` and `text_extraction` fields to describe + * the entity from the text snippet. Multiple JSON documents can be separated + * using line breaks (\n). + * The supplied text must be annotated exhaustively. For example, if you + * include the text "horse", but do not label it as "animal", + * then "horse" is assumed to not be an "animal". + * Any given text snippet content must have 30,000 characters or + * less, and also be UTF-8 NFC encoded. ASCII is accepted as it is + * UTF-8 NFC encoded. + * For example: + * { + * "text_snippet": { + * "content": "dog car cat" + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 0, "end_offset": 2} + * } + * }, + * { + * "display_name": "vehicle", + * "text_extraction": { + * "text_segment": {"start_offset": 4, "end_offset": 6} + * } + * }, + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 8, "end_offset": 10} + * } + * } + * ] + * }\n + * { + * "text_snippet": { + * "content": "This dog is good." + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 5, "end_offset": 7} + * } + * } + * ] + * } + * **JSONL files that reference documents** + * .JSONL files contain, per line, a JSON document that wraps a + * `input_config` that contains the path to a source document. + * Multiple JSON documents can be separated using line breaks (\n). + * Supported document extensions: .PDF, .TIF, .TIFF + * For example: + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] + * } + * } + * } + * }\n + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document2.tif" ] + * } + * } + * } + * } + * **In-line JSONL files with document layout information** + * **Note:** You can only annotate documents using the UI. The format described + * below applies to annotated documents exported using the UI or `exportData`. + * In-line .JSONL files for documents contain, per line, a JSON document + * that wraps a `document` field that provides the textual content of the + * document and the layout information. + * For example: + * { + * "document": { + * "document_text": { + * "content": "dog car cat" + * } + * "layout": [ + * { + * "text_segment": { + * "start_offset": 0, + * "end_offset": 11, + * }, + * "page_number": 1, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.1, "y": 0.1}, + * {"x": 0.1, "y": 0.3}, + * {"x": 0.3, "y": 0.3}, + * {"x": 0.3, "y": 0.1}, + * ], + * }, + * "text_segment_type": TOKEN, + * } + * ], + * "document_dimensions": { + * "width": 8.27, + * "height": 11.69, + * "unit": INCH, + * } + * "page_count": 3, + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 0, "end_offset": 3} + * } + * }, + * { + * "display_name": "vehicle", + * "text_extraction": { + * "text_segment": {"start_offset": 4, "end_offset": 7} + * } + * }, + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 8, "end_offset": 11} + * } + * }, + * ], + * ##### Classification + * See [Preparing your training + * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more + * information. + * One or more CSV file(s) with each line in the following format: + * ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing. + * * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If + * the column content is a valid Google Cloud Storage file path, that is, + * prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if + * the content is enclosed in double quotes (""), it is treated as a + * `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a + * file with supported extension and UTF-8 encoding, for example, + * "gs://folder/content.txt" AutoML imports the file content + * as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content + * excluding quotes. In both cases, size of the content must be 10MB or + * less in size. For zip files, the size of each file inside the zip must be + * 10MB or less in size. + * For the `MULTICLASS` classification type, at most one `LABEL` is allowed. + * The `ML_USE` and `LABEL` columns are optional. + * Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP + * A maximum of 100 unique labels are allowed per CSV row. + * Sample rows: + * TRAIN,"They have bad food and very rude",RudeService,BadFood + * gs://folder/content.txt,SlowService + * TEST,gs://folder/document.pdf + * VALIDATE,gs://folder/text_files.zip,BadFood + * ##### Sentiment Analysis + * See [Preparing your training + * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more + * information. + * CSV file(s) with each line in format: + * ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing. + * * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If + * the column content is a valid Google Cloud Storage file path, that is, + * prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if + * the content is enclosed in double quotes (""), it is treated as a + * `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a + * file with supported extension and UTF-8 encoding, for example, + * "gs://folder/content.txt" AutoML imports the file content + * as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content + * excluding quotes. In both cases, size of the content must be 128kB or + * less in size. For zip files, the size of each file inside the zip must be + * 128kB or less in size. + * The `ML_USE` and `SENTIMENT` columns are optional. + * Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP + * * `SENTIMENT` - An integer between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max + * (inclusive). Describes the ordinal of the sentiment - higher + * value means a more positive sentiment. All the values are + * completely relative, i.e. neither 0 needs to mean a negative or + * neutral sentiment nor sentiment_max needs to mean a positive one - + * it is just required that 0 is the least positive sentiment + * in the data, and sentiment_max is the most positive one. + * The SENTIMENT shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * All SENTIMENT values between 0 and sentiment_max must be + * represented in the imported data. On prediction the same 0 to + * sentiment_max range will be used. The difference between + * neighboring sentiment values needs not to be uniform, e.g. 1 and + * 2 may be similar whereas the difference between 2 and 3 may be + * large. + * Sample rows: + * TRAIN,"@freewrytin this is way too good for your product",2 + * gs://folder/content.txt,3 + * TEST,gs://folder/document.pdf + * VALIDATE,gs://folder/text_files.zip,2 + * #### AutoML Tables + * See [Preparing your training + * data](https://cloud.google.com/automl-tables/docs/prepare) for more + * information. + * You can use either + * [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] or + * [bigquery_source][google.cloud.automl.v1.InputConfig.bigquery_source]. + * All input is concatenated into a + * single + * [primary_table_spec_id][google.cloud.automl.v1.TablesDatasetMetadata.primary_table_spec_id] + * **For gcs_source:** + * CSV file(s), where the first row of the first file is the header, + * containing unique column names. If the first row of a subsequent + * file is the same as the header, then it is also treated as a + * header. All other rows contain values for the corresponding + * columns. + * Each .CSV file by itself must be 10GB or smaller, and their total + * size must be 100GB or smaller. + * First three sample rows of a CSV file: + *
+ * "Id","First Name","Last Name","Dob","Addresses"
+ * "1","John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
+ * "2","Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
+ * 
+ * **For bigquery_source:** + * An URI of a BigQuery table. The user data size of the BigQuery + * table must be 100GB or smaller. + * An imported table must have between 2 and 1,000 columns, inclusive, + * and between 1000 and 100,000,000 rows, inclusive. There are at most 5 + * import data running in parallel. + * **Input field definitions:** + * `ML_USE` + * : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED") + * Describes how the given example (file) should be used for model + * training. "UNASSIGNED" can be used when user has no preference. + * `GCS_FILE_PATH` + * : The path to a file on Google Cloud Storage. For example, + * "gs://folder/image1.png". + * `LABEL` + * : A display name of an object on an image, video etc., e.g. "dog". + * Must be up to 32 characters long and can consist only of ASCII + * Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. + * For each label an AnnotationSpec is created which display_name + * becomes the label; AnnotationSpecs are given back in predictions. + * `INSTANCE_ID` + * : A positive integer that identifies a specific instance of a + * labeled entity on an example. Used e.g. to track two cars on + * a video while being able to tell apart which one is which. + * `BOUNDING_BOX` + * : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`) + * A rectangle parallel to the frame of the example (image, + * video). If 4 vertices are given they are connected by edges + * in the order provided, if 2 are given they are recognized + * as diagonally opposite vertices of the rectangle. + * `VERTEX` + * : (`COORDINATE,COORDINATE`) + * First coordinate is horizontal (x), the second is vertical (y). + * `COORDINATE` + * : A float in 0 to 1 range, relative to total length of + * image or video in given dimension. For fractions the + * leading non-decimal 0 can be omitted (i.e. 0.3 = .3). + * Point 0,0 is in top left. + * `TIME_SEGMENT_START` + * : (`TIME_OFFSET`) + * Expresses a beginning, inclusive, of a time segment + * within an example that has a time dimension + * (e.g. video). + * `TIME_SEGMENT_END` + * : (`TIME_OFFSET`) + * Expresses an end, exclusive, of a time segment within + * n example that has a time dimension (e.g. video). + * `TIME_OFFSET` + * : A number of seconds as measured from the start of an + * example (e.g. video). Fractions are allowed, up to a + * microsecond precision. "inf" is allowed, and it means the end + * of the example. + * `TEXT_SNIPPET` + * : The content of a text snippet, UTF-8 encoded, enclosed within + * double quotes (""). + * `DOCUMENT` + * : A field that provides the textual content with document and the layout + * information. + * **Errors:** + * If any of the provided CSV files can't be parsed or if more than certain + * percent of CSV rows cannot be processed then the operation fails and + * nothing is imported. Regardless of overall success or failure the per-row + * failures, up to a certain count cap, is listed in + * Operation.metadata.partial_failures. + * + * Generated from protobuf message google.cloud.automl.v1.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Additional domain-specific parameters describing the semantic of the + * imported data, any string must be up to 25000 + * characters long. + * #### AutoML Tables + * `schema_inference_version` + * : (integer) This value must be supplied. + * The version of the + * algorithm to use for the initial inference of the + * column data types of the imported table. Allowed values: "1". + * + * Generated from protobuf field map params = 2; + */ + private $params; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsSource $gcs_source + * The Google Cloud Storage location for the input content. + * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], + * `gcs_source` points to a CSV file with a structure described in + * [InputConfig][google.cloud.automl.v1.InputConfig]. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional domain-specific parameters describing the semantic of the + * imported data, any string must be up to 25000 + * characters long. + * #### AutoML Tables + * `schema_inference_version` + * : (integer) This value must be supplied. + * The version of the + * algorithm to use for the initial inference of the + * column data types of the imported table. Allowed values: "1". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud Storage location for the input content. + * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], + * `gcs_source` points to a CSV file with a structure described in + * [InputConfig][google.cloud.automl.v1.InputConfig]. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + * @return \Google\Cloud\AutoMl\V1\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(1); + } + + public function hasGcsSource() + { + return $this->hasOneof(1); + } + + /** + * The Google Cloud Storage location for the input content. + * For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], + * `gcs_source` points to a CSV file with a structure described in + * [InputConfig][google.cloud.automl.v1.InputConfig]. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsSource gcs_source = 1; + * @param \Google\Cloud\AutoMl\V1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Additional domain-specific parameters describing the semantic of the + * imported data, any string must be up to 25000 + * characters long. + * #### AutoML Tables + * `schema_inference_version` + * : (integer) This value must be supplied. + * The version of the + * algorithm to use for the initial inference of the + * column data types of the imported table. Allowed values: "1". + * + * Generated from protobuf field map params = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional domain-specific parameters describing the semantic of the + * imported data, any string must be up to 25000 + * characters long. + * #### AutoML Tables + * `schema_inference_version` + * : (integer) This value must be supplied. + * The version of the + * algorithm to use for the initial inference of the + * column data types of the imported table. Allowed values: "1". + * + * Generated from protobuf field map params = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->params = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsRequest.php new file mode 100644 index 000000000000..e769688ed858 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsRequest.php @@ -0,0 +1,215 @@ +google.cloud.automl.v1.ListDatasetsRequest + */ +class ListDatasetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the project from which to list datasets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the project from which to list datasets. Please see + * {@see AutoMlClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\ListDatasetsRequest + * + * @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 project from which to list datasets. + * @type string $filter + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @type int $page_size + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @type string $page_token + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the project from which to list datasets. + * + * 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 project from which to list datasets. + * + * 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; + } + + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + * [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + * + * Generated from protobuf field string page_token = 6; + * @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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsResponse.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsResponse.php new file mode 100644 index 000000000000..f2d797616ee3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListDatasetsResponse.php @@ -0,0 +1,105 @@ +google.cloud.automl.v1.ListDatasetsResponse + */ +class ListDatasetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The datasets read. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Dataset datasets = 1; + */ + private $datasets; + /** + * A token to retrieve next page of results. + * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + * + * 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\AutoMl\V1\Dataset>|\Google\Protobuf\Internal\RepeatedField $datasets + * The datasets read. + * @type string $next_page_token + * A token to retrieve next page of results. + * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The datasets read. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Dataset datasets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatasets() + { + return $this->datasets; + } + + /** + * The datasets read. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Dataset datasets = 1; + * @param array<\Google\Cloud\AutoMl\V1\Dataset>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatasets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\Dataset::class); + $this->datasets = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsRequest.php new file mode 100644 index 000000000000..cd2ede27676c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsRequest.php @@ -0,0 +1,245 @@ +google.cloud.automl.v1.ListModelEvaluationsRequest + */ +class ListModelEvaluationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * @param string $filter Required. An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * + * @return \Google\Cloud\AutoMl\V1\ListModelEvaluationsRequest + * + * @experimental + */ + public static function build(string $parent, string $filter): self + { + return (new self()) + ->setParent($parent) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @type string $filter + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @type int $page_size + * Requested page size. + * @type string $page_token + * A token identifying a page of results for the server to return. + * Typically obtained via + * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent 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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent 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. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + * + * Generated from protobuf field string page_token = 6; + * @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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsResponse.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsResponse.php new file mode 100644 index 000000000000..c1bfdafea3e1 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelEvaluationsResponse.php @@ -0,0 +1,109 @@ +google.cloud.automl.v1.ListModelEvaluationsResponse + */ +class ListModelEvaluationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of model evaluations in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + */ + private $model_evaluation; + /** + * A token to retrieve next page of results. + * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + * + * 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\AutoMl\V1\ModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $model_evaluation + * List of model evaluations in the requested page. + * @type string $next_page_token + * A token to retrieve next page of results. + * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * List of model evaluations in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModelEvaluation() + { + return $this->model_evaluation; + } + + /** + * List of model evaluations in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.ModelEvaluation model_evaluation = 1; + * @param array<\Google\Cloud\AutoMl\V1\ModelEvaluation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModelEvaluation($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\ModelEvaluation::class); + $this->model_evaluation = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + * [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsRequest.php new file mode 100644 index 000000000000..948b62bb0955 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsRequest.php @@ -0,0 +1,219 @@ +google.cloud.automl.v1.ListModelsRequest + */ +class ListModelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the project, from which to list the models. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + * + * Generated from protobuf field string page_token = 6; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. Resource name of the project, from which to list the models. Please see + * {@see AutoMlClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\ListModelsRequest + * + * @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. Resource name of the project, from which to list the models. + * @type string $filter + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @type int $page_size + * Requested page size. + * @type string $page_token + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the project, from which to list the models. + * + * 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. Resource name of the project, from which to list the models. + * + * 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; + } + + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Requested page size. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + * + * Generated from protobuf field string page_token = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + * [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + * + * Generated from protobuf field string page_token = 6; + * @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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsResponse.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsResponse.php new file mode 100644 index 000000000000..f59c0ca288d3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ListModelsResponse.php @@ -0,0 +1,105 @@ +google.cloud.automl.v1.ListModelsResponse + */ +class ListModelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of models in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Model model = 1; + */ + private $model; + /** + * A token to retrieve next page of results. + * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + * + * 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\AutoMl\V1\Model>|\Google\Protobuf\Internal\RepeatedField $model + * List of models in the requested page. + * @type string $next_page_token + * A token to retrieve next page of results. + * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * List of models in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Model model = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModel() + { + return $this->model; + } + + /** + * List of models in the requested page. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.Model model = 1; + * @param array<\Google\Cloud\AutoMl\V1\Model>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModel($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\Model::class); + $this->model = $arr; + + return $this; + } + + /** + * A token to retrieve next page of results. + * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve next page of results. + * Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model.php new file mode 100644 index 000000000000..0d84d2014398 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model.php @@ -0,0 +1,580 @@ +google.cloud.automl.v1.Model + */ +class Model extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of the model. + * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The name of the model to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. It must start with a letter. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * Required. The resource ID of the dataset used to create the model. The dataset must + * come from the same ancestor project and location. + * + * Generated from protobuf field string dataset_id = 3; + */ + protected $dataset_id = ''; + /** + * Output only. Timestamp when the model training finished and can be used for prediction. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + */ + protected $create_time = null; + /** + * Output only. Timestamp when this model was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + */ + protected $update_time = null; + /** + * Output only. Deployment state of the model. A model can only serve + * prediction requests after it gets deployed. + * + * Generated from protobuf field .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + */ + protected $deployment_state = 0; + /** + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 10; + */ + protected $etag = ''; + /** + * Optional. The labels with user-defined metadata to organize your model. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), 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. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 34; + */ + private $labels; + protected $model_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TranslationModelMetadata $translation_model_metadata + * Metadata for translation models. + * @type \Google\Cloud\AutoMl\V1\ImageClassificationModelMetadata $image_classification_model_metadata + * Metadata for image classification models. + * @type \Google\Cloud\AutoMl\V1\TextClassificationModelMetadata $text_classification_model_metadata + * Metadata for text classification models. + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelMetadata $image_object_detection_model_metadata + * Metadata for image object detection models. + * @type \Google\Cloud\AutoMl\V1\TextExtractionModelMetadata $text_extraction_model_metadata + * Metadata for text extraction models. + * @type \Google\Cloud\AutoMl\V1\TextSentimentModelMetadata $text_sentiment_model_metadata + * Metadata for text sentiment models. + * @type string $name + * Output only. Resource name of the model. + * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + * @type string $display_name + * Required. The name of the model to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. It must start with a letter. + * @type string $dataset_id + * Required. The resource ID of the dataset used to create the model. The dataset must + * come from the same ancestor project and location. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the model training finished and can be used for prediction. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when this model was last updated. + * @type int $deployment_state + * Output only. Deployment state of the model. A model can only serve + * prediction requests after it gets deployed. + * @type string $etag + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels with user-defined metadata to organize your model. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), 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. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Model::initOnce(); + parent::__construct($data); + } + + /** + * Metadata for translation models. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * @return \Google\Cloud\AutoMl\V1\TranslationModelMetadata|null + */ + public function getTranslationModelMetadata() + { + return $this->readOneof(15); + } + + public function hasTranslationModelMetadata() + { + return $this->hasOneof(15); + } + + /** + * Metadata for translation models. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationModelMetadata translation_model_metadata = 15; + * @param \Google\Cloud\AutoMl\V1\TranslationModelMetadata $var + * @return $this + */ + public function setTranslationModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationModelMetadata::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Metadata for image classification models. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * @return \Google\Cloud\AutoMl\V1\ImageClassificationModelMetadata|null + */ + public function getImageClassificationModelMetadata() + { + return $this->readOneof(13); + } + + public function hasImageClassificationModelMetadata() + { + return $this->hasOneof(13); + } + + /** + * Metadata for image classification models. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageClassificationModelMetadata image_classification_model_metadata = 13; + * @param \Google\Cloud\AutoMl\V1\ImageClassificationModelMetadata $var + * @return $this + */ + public function setImageClassificationModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageClassificationModelMetadata::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Metadata for text classification models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * @return \Google\Cloud\AutoMl\V1\TextClassificationModelMetadata|null + */ + public function getTextClassificationModelMetadata() + { + return $this->readOneof(14); + } + + public function hasTextClassificationModelMetadata() + { + return $this->hasOneof(14); + } + + /** + * Metadata for text classification models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextClassificationModelMetadata text_classification_model_metadata = 14; + * @param \Google\Cloud\AutoMl\V1\TextClassificationModelMetadata $var + * @return $this + */ + public function setTextClassificationModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextClassificationModelMetadata::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Metadata for image object detection models. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelMetadata|null + */ + public function getImageObjectDetectionModelMetadata() + { + return $this->readOneof(20); + } + + public function hasImageObjectDetectionModelMetadata() + { + return $this->hasOneof(20); + } + + /** + * Metadata for image object detection models. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelMetadata $var + * @return $this + */ + public function setImageObjectDetectionModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionModelMetadata::class); + $this->writeOneof(20, $var); + + return $this; + } + + /** + * Metadata for text extraction models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * @return \Google\Cloud\AutoMl\V1\TextExtractionModelMetadata|null + */ + public function getTextExtractionModelMetadata() + { + return $this->readOneof(19); + } + + public function hasTextExtractionModelMetadata() + { + return $this->hasOneof(19); + } + + /** + * Metadata for text extraction models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionModelMetadata text_extraction_model_metadata = 19; + * @param \Google\Cloud\AutoMl\V1\TextExtractionModelMetadata $var + * @return $this + */ + public function setTextExtractionModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextExtractionModelMetadata::class); + $this->writeOneof(19, $var); + + return $this; + } + + /** + * Metadata for text sentiment models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * @return \Google\Cloud\AutoMl\V1\TextSentimentModelMetadata|null + */ + public function getTextSentimentModelMetadata() + { + return $this->readOneof(22); + } + + public function hasTextSentimentModelMetadata() + { + return $this->hasOneof(22); + } + + /** + * Metadata for text sentiment models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentModelMetadata text_sentiment_model_metadata = 22; + * @param \Google\Cloud\AutoMl\V1\TextSentimentModelMetadata $var + * @return $this + */ + public function setTextSentimentModelMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSentimentModelMetadata::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Output only. Resource name of the model. + * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of the model. + * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * 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; + } + + /** + * Required. The name of the model to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. It must start with a letter. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the model to show in the interface. The name can be + * up to 32 characters long and can consist only of ASCII Latin letters A-Z + * and a-z, underscores + * (_), and ASCII digits 0-9. It must start with a letter. + * + * 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; + } + + /** + * Required. The resource ID of the dataset used to create the model. The dataset must + * come from the same ancestor project and location. + * + * Generated from protobuf field string dataset_id = 3; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Required. The resource ID of the dataset used to create the model. The dataset must + * come from the same ancestor project and location. + * + * Generated from protobuf field string dataset_id = 3; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Output only. Timestamp when the model training finished and can be used for prediction. + * + * 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); + } + + /** + * Output only. Timestamp when the model training finished and can be used for prediction. + * + * 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; + } + + /** + * Output only. Timestamp when this model was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Timestamp when this model was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. Deployment state of the model. A model can only serve + * prediction requests after it gets deployed. + * + * Generated from protobuf field .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + * @return int + */ + public function getDeploymentState() + { + return $this->deployment_state; + } + + /** + * Output only. Deployment state of the model. A model can only serve + * prediction requests after it gets deployed. + * + * Generated from protobuf field .google.cloud.automl.v1.Model.DeploymentState deployment_state = 8; + * @param int $var + * @return $this + */ + public function setDeploymentState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\Model\DeploymentState::class); + $this->deployment_state = $var; + + return $this; + } + + /** + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 10; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * + * Generated from protobuf field string etag = 10; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. The labels with user-defined metadata to organize your model. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), 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. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 34; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels with user-defined metadata to organize your model. + * Label keys and values can be no longer than 64 characters + * (Unicode codepoints), 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. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 34; + * @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; + } + + /** + * @return string + */ + public function getModelMetadata() + { + return $this->whichOneof("model_metadata"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model/DeploymentState.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model/DeploymentState.php new file mode 100644 index 000000000000..717194cacb0f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/Model/DeploymentState.php @@ -0,0 +1,64 @@ +google.cloud.automl.v1.Model.DeploymentState + */ +class DeploymentState +{ + /** + * Should not be used, an un-set enum has this value by default. + * + * Generated from protobuf enum DEPLOYMENT_STATE_UNSPECIFIED = 0; + */ + const DEPLOYMENT_STATE_UNSPECIFIED = 0; + /** + * Model is deployed. + * + * Generated from protobuf enum DEPLOYED = 1; + */ + const DEPLOYED = 1; + /** + * Model is not deployed. + * + * Generated from protobuf enum UNDEPLOYED = 2; + */ + const UNDEPLOYED = 2; + + private static $valueToName = [ + self::DEPLOYMENT_STATE_UNSPECIFIED => 'DEPLOYMENT_STATE_UNSPECIFIED', + self::DEPLOYED => 'DEPLOYED', + self::UNDEPLOYED => 'UNDEPLOYED', + ]; + + 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(DeploymentState::class, \Google\Cloud\AutoMl\V1\Model_DeploymentState::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelEvaluation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelEvaluation.php new file mode 100644 index 000000000000..bbe35143df37 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelEvaluation.php @@ -0,0 +1,496 @@ +google.cloud.automl.v1.ModelEvaluation + */ +class ModelEvaluation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of the model evaluation. + * Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The ID of the annotation spec that the model evaluation applies to. The + * The ID is empty for the overall model evaluation. + * For Tables annotation specs in the dataset do not exist and this ID is + * always not set, but for CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * the + * [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + * field is used. + * + * Generated from protobuf field string annotation_spec_id = 2; + */ + protected $annotation_spec_id = ''; + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. For Tables CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * distinct values of the target column at the moment of the model evaluation + * are populated here. + * The display_name is empty for the overall model evaluation. + * + * Generated from protobuf field string display_name = 15; + */ + protected $display_name = ''; + /** + * Output only. Timestamp when this model evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + */ + protected $create_time = null; + /** + * Output only. The number of examples used for model evaluation, i.e. for + * which ground truth from time of model creation is compared against the + * predicted annotations created by the model. + * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + * the total number of all examples used for evaluation. + * Otherwise, this is the count of examples that according to the ground + * truth were annotated by the + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + * + * Generated from protobuf field int32 evaluated_example_count = 6; + */ + protected $evaluated_example_count = 0; + protected $metrics; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics $classification_evaluation_metrics + * Model evaluation metrics for image, text, video and tables + * classification. + * Tables problem is considered a classification when the target column + * is CATEGORY DataType. + * @type \Google\Cloud\AutoMl\V1\TranslationEvaluationMetrics $translation_evaluation_metrics + * Model evaluation metrics for translation. + * @type \Google\Cloud\AutoMl\V1\ImageObjectDetectionEvaluationMetrics $image_object_detection_evaluation_metrics + * Model evaluation metrics for image object detection. + * @type \Google\Cloud\AutoMl\V1\TextSentimentEvaluationMetrics $text_sentiment_evaluation_metrics + * Evaluation metrics for text sentiment models. + * @type \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics $text_extraction_evaluation_metrics + * Evaluation metrics for text extraction models. + * @type string $name + * Output only. Resource name of the model evaluation. + * Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + * @type string $annotation_spec_id + * Output only. The ID of the annotation spec that the model evaluation applies to. The + * The ID is empty for the overall model evaluation. + * For Tables annotation specs in the dataset do not exist and this ID is + * always not set, but for CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * the + * [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + * field is used. + * @type string $display_name + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. For Tables CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * distinct values of the target column at the moment of the model evaluation + * are populated here. + * The display_name is empty for the overall model evaluation. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when this model evaluation was created. + * @type int $evaluated_example_count + * Output only. The number of examples used for model evaluation, i.e. for + * which ground truth from time of model creation is compared against the + * predicted annotations created by the model. + * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + * the total number of all examples used for evaluation. + * Otherwise, this is the count of examples that according to the ground + * truth were annotated by the + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\ModelEvaluation::initOnce(); + parent::__construct($data); + } + + /** + * Model evaluation metrics for image, text, video and tables + * classification. + * Tables problem is considered a classification when the target column + * is CATEGORY DataType. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * @return \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics|null + */ + public function getClassificationEvaluationMetrics() + { + return $this->readOneof(8); + } + + public function hasClassificationEvaluationMetrics() + { + return $this->hasOneof(8); + } + + /** + * Model evaluation metrics for image, text, video and tables + * classification. + * Tables problem is considered a classification when the target column + * is CATEGORY DataType. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + * @param \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics $var + * @return $this + */ + public function setClassificationEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Model evaluation metrics for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * @return \Google\Cloud\AutoMl\V1\TranslationEvaluationMetrics|null + */ + public function getTranslationEvaluationMetrics() + { + return $this->readOneof(9); + } + + public function hasTranslationEvaluationMetrics() + { + return $this->hasOneof(9); + } + + /** + * Model evaluation metrics for translation. + * + * Generated from protobuf field .google.cloud.automl.v1.TranslationEvaluationMetrics translation_evaluation_metrics = 9; + * @param \Google\Cloud\AutoMl\V1\TranslationEvaluationMetrics $var + * @return $this + */ + public function setTranslationEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TranslationEvaluationMetrics::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Model evaluation metrics for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * @return \Google\Cloud\AutoMl\V1\ImageObjectDetectionEvaluationMetrics|null + */ + public function getImageObjectDetectionEvaluationMetrics() + { + return $this->readOneof(12); + } + + public function hasImageObjectDetectionEvaluationMetrics() + { + return $this->hasOneof(12); + } + + /** + * Model evaluation metrics for image object detection. + * + * Generated from protobuf field .google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + * @param \Google\Cloud\AutoMl\V1\ImageObjectDetectionEvaluationMetrics $var + * @return $this + */ + public function setImageObjectDetectionEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImageObjectDetectionEvaluationMetrics::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Evaluation metrics for text sentiment models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * @return \Google\Cloud\AutoMl\V1\TextSentimentEvaluationMetrics|null + */ + public function getTextSentimentEvaluationMetrics() + { + return $this->readOneof(11); + } + + public function hasTextSentimentEvaluationMetrics() + { + return $this->hasOneof(11); + } + + /** + * Evaluation metrics for text sentiment models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + * @param \Google\Cloud\AutoMl\V1\TextSentimentEvaluationMetrics $var + * @return $this + */ + public function setTextSentimentEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSentimentEvaluationMetrics::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Evaluation metrics for text extraction models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * @return \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics|null + */ + public function getTextExtractionEvaluationMetrics() + { + return $this->readOneof(13); + } + + public function hasTextExtractionEvaluationMetrics() + { + return $this->hasOneof(13); + } + + /** + * Evaluation metrics for text extraction models. + * + * Generated from protobuf field .google.cloud.automl.v1.TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + * @param \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics $var + * @return $this + */ + public function setTextExtractionEvaluationMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Output only. Resource name of the model evaluation. + * Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of the model evaluation. + * Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + * + * 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; + } + + /** + * Output only. The ID of the annotation spec that the model evaluation applies to. The + * The ID is empty for the overall model evaluation. + * For Tables annotation specs in the dataset do not exist and this ID is + * always not set, but for CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * the + * [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + * field is used. + * + * Generated from protobuf field string annotation_spec_id = 2; + * @return string + */ + public function getAnnotationSpecId() + { + return $this->annotation_spec_id; + } + + /** + * Output only. The ID of the annotation spec that the model evaluation applies to. The + * The ID is empty for the overall model evaluation. + * For Tables annotation specs in the dataset do not exist and this ID is + * always not set, but for CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * the + * [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + * field is used. + * + * Generated from protobuf field string annotation_spec_id = 2; + * @param string $var + * @return $this + */ + public function setAnnotationSpecId($var) + { + GPBUtil::checkString($var, True); + $this->annotation_spec_id = $var; + + return $this; + } + + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. For Tables CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * distinct values of the target column at the moment of the model evaluation + * are populated here. + * The display_name is empty for the overall model evaluation. + * + * Generated from protobuf field string display_name = 15; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. The value of + * [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. For Tables CLASSIFICATION + * [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + * distinct values of the target column at the moment of the model evaluation + * are populated here. + * The display_name is empty for the overall model evaluation. + * + * Generated from protobuf field string display_name = 15; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Timestamp when this model evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @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); + } + + /** + * Output only. Timestamp when this model evaluation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The number of examples used for model evaluation, i.e. for + * which ground truth from time of model creation is compared against the + * predicted annotations created by the model. + * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + * the total number of all examples used for evaluation. + * Otherwise, this is the count of examples that according to the ground + * truth were annotated by the + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + * + * Generated from protobuf field int32 evaluated_example_count = 6; + * @return int + */ + public function getEvaluatedExampleCount() + { + return $this->evaluated_example_count; + } + + /** + * Output only. The number of examples used for model evaluation, i.e. for + * which ground truth from time of model creation is compared against the + * predicted annotations created by the model. + * For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + * the total number of all examples used for evaluation. + * Otherwise, this is the count of examples that according to the ground + * truth were annotated by the + * [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + * + * Generated from protobuf field int32 evaluated_example_count = 6; + * @param int $var + * @return $this + */ + public function setEvaluatedExampleCount($var) + { + GPBUtil::checkInt32($var); + $this->evaluated_example_count = $var; + + return $this; + } + + /** + * @return string + */ + public function getMetrics() + { + return $this->whichOneof("metrics"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelExportOutputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelExportOutputConfig.php new file mode 100644 index 000000000000..47df2eba0472 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/ModelExportOutputConfig.php @@ -0,0 +1,291 @@ +google.cloud.automl.v1.ModelExportOutputConfig + */ +class ModelExportOutputConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. + * * docker - Used for Docker containers. Use the params field to customize + * the container. The container is verified to work correctly on + * ubuntu 16.04 operating system. See more at + * [containers + * quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + * * core_ml - Used for iOS mobile devices. + * + * Generated from protobuf field string model_format = 4; + */ + protected $model_format = ''; + /** + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * * For `docker` format: + * `cpu_architecture` - (string) "x86_64" (default). + * `gpu_architecture` - (string) "none" (default), "nvidia". + * + * Generated from protobuf field map params = 2; + */ + private $params; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsDestination $gcs_destination + * Required. The Google Cloud Storage location where the model is to be + * written to. This location may only be set for the following model + * formats: + * "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + * Under the directory given as the destination a new one with name + * "model-export--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + * will be created. Inside the model and any of its supporting files + * will be written. + * @type string $model_format + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. + * * docker - Used for Docker containers. Use the params field to customize + * the container. The container is verified to work correctly on + * ubuntu 16.04 operating system. See more at + * [containers + * quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + * * core_ml - Used for iOS mobile devices. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * * For `docker` format: + * `cpu_architecture` - (string) "x86_64" (default). + * `gpu_architecture` - (string) "none" (default), "nvidia". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Google Cloud Storage location where the model is to be + * written to. This location may only be set for the following model + * formats: + * "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + * Under the directory given as the destination a new one with name + * "model-export--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + * will be created. Inside the model and any of its supporting files + * will be written. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Required. The Google Cloud Storage location where the model is to be + * written to. This location may only be set for the following model + * formats: + * "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + * Under the directory given as the destination a new one with name + * "model-export--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + * will be created. Inside the model and any of its supporting files + * will be written. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. + * * docker - Used for Docker containers. Use the params field to customize + * the container. The container is verified to work correctly on + * ubuntu 16.04 operating system. See more at + * [containers + * quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + * * core_ml - Used for iOS mobile devices. + * + * Generated from protobuf field string model_format = 4; + * @return string + */ + public function getModelFormat() + { + return $this->model_format; + } + + /** + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. + * * docker - Used for Docker containers. Use the params field to customize + * the container. The container is verified to work correctly on + * ubuntu 16.04 operating system. See more at + * [containers + * quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + * * core_ml - Used for iOS mobile devices. + * + * Generated from protobuf field string model_format = 4; + * @param string $var + * @return $this + */ + public function setModelFormat($var) + { + GPBUtil::checkString($var, True); + $this->model_format = $var; + + return $this; + } + + /** + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * * For `docker` format: + * `cpu_architecture` - (string) "x86_64" (default). + * `gpu_architecture` - (string) "none" (default), "nvidia". + * + * Generated from protobuf field map params = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * * For `docker` format: + * `cpu_architecture` - (string) "x86_64" (default). + * `gpu_architecture` - (string) "none" (default), "nvidia". + * + * Generated from protobuf field map params = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->params = $arr; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/NormalizedVertex.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/NormalizedVertex.php new file mode 100644 index 000000000000..f32853bc25e8 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/NormalizedVertex.php @@ -0,0 +1,105 @@ +google.cloud.automl.v1.NormalizedVertex + */ +class NormalizedVertex extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Horizontal coordinate. + * + * Generated from protobuf field float x = 1; + */ + protected $x = 0.0; + /** + * Required. Vertical coordinate. + * + * 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 + * Required. Horizontal coordinate. + * @type float $y + * Required. Vertical coordinate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Geometry::initOnce(); + parent::__construct($data); + } + + /** + * Required. Horizontal coordinate. + * + * Generated from protobuf field float x = 1; + * @return float + */ + public function getX() + { + return $this->x; + } + + /** + * Required. Horizontal 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; + } + + /** + * Required. Vertical coordinate. + * + * Generated from protobuf field float y = 2; + * @return float + */ + public function getY() + { + return $this->y; + } + + /** + * Required. Vertical coordinate. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OperationMetadata.php new file mode 100644 index 000000000000..e6b98b84fc49 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OperationMetadata.php @@ -0,0 +1,511 @@ +google.cloud.automl.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Progress of operation. Range: [0, 100]. + * Not used currently. + * + * Generated from protobuf field int32 progress_percent = 13; + */ + protected $progress_percent = 0; + /** + * Output only. Partial failures encountered. + * E.g. single files that couldn't be read. + * This field should never exceed 20 entries. + * Status details field will contain standard GCP error details. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + */ + private $partial_failures; + /** + * Output only. Time when the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * Output only. Time when the operation was updated for the last time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + protected $details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\DeleteOperationMetadata $delete_details + * Details of a Delete operation. + * @type \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata $deploy_model_details + * Details of a DeployModel operation. + * @type \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata $undeploy_model_details + * Details of an UndeployModel operation. + * @type \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata $create_model_details + * Details of CreateModel operation. + * @type \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata $create_dataset_details + * Details of CreateDataset operation. + * @type \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata $import_data_details + * Details of ImportData operation. + * @type \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata $batch_predict_details + * Details of BatchPredict operation. + * @type \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata $export_data_details + * Details of ExportData operation. + * @type \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata $export_model_details + * Details of ExportModel operation. + * @type int $progress_percent + * Output only. Progress of operation. Range: [0, 100]. + * Not used currently. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $partial_failures + * Output only. Partial failures encountered. + * E.g. single files that couldn't be read. + * This field should never exceed 20 entries. + * Status details field will contain standard GCP error details. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when the operation was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time when the operation was updated for the last time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + + /** + * Details of a Delete operation. + * + * Generated from protobuf field .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + * @return \Google\Cloud\AutoMl\V1\DeleteOperationMetadata|null + */ + public function getDeleteDetails() + { + return $this->readOneof(8); + } + + public function hasDeleteDetails() + { + return $this->hasOneof(8); + } + + /** + * Details of a Delete operation. + * + * Generated from protobuf field .google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8; + * @param \Google\Cloud\AutoMl\V1\DeleteOperationMetadata $var + * @return $this + */ + public function setDeleteDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DeleteOperationMetadata::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Details of a DeployModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + * @return \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata|null + */ + public function getDeployModelDetails() + { + return $this->readOneof(24); + } + + public function hasDeployModelDetails() + { + return $this->hasOneof(24); + } + + /** + * Details of a DeployModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24; + * @param \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata $var + * @return $this + */ + public function setDeployModelDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata::class); + $this->writeOneof(24, $var); + + return $this; + } + + /** + * Details of an UndeployModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * @return \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata|null + */ + public function getUndeployModelDetails() + { + return $this->readOneof(25); + } + + public function hasUndeployModelDetails() + { + return $this->hasOneof(25); + } + + /** + * Details of an UndeployModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25; + * @param \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata $var + * @return $this + */ + public function setUndeployModelDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata::class); + $this->writeOneof(25, $var); + + return $this; + } + + /** + * Details of CreateModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * @return \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata|null + */ + public function getCreateModelDetails() + { + return $this->readOneof(10); + } + + public function hasCreateModelDetails() + { + return $this->hasOneof(10); + } + + /** + * Details of CreateModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10; + * @param \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata $var + * @return $this + */ + public function setCreateModelDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Details of CreateDataset operation. + * + * Generated from protobuf field .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * @return \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata|null + */ + public function getCreateDatasetDetails() + { + return $this->readOneof(30); + } + + public function hasCreateDatasetDetails() + { + return $this->hasOneof(30); + } + + /** + * Details of CreateDataset operation. + * + * Generated from protobuf field .google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30; + * @param \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata $var + * @return $this + */ + public function setCreateDatasetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata::class); + $this->writeOneof(30, $var); + + return $this; + } + + /** + * Details of ImportData operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + * @return \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata|null + */ + public function getImportDataDetails() + { + return $this->readOneof(15); + } + + public function hasImportDataDetails() + { + return $this->hasOneof(15); + } + + /** + * Details of ImportData operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15; + * @param \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata $var + * @return $this + */ + public function setImportDataDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Details of BatchPredict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * @return \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata|null + */ + public function getBatchPredictDetails() + { + return $this->readOneof(16); + } + + public function hasBatchPredictDetails() + { + return $this->hasOneof(16); + } + + /** + * Details of BatchPredict operation. + * + * Generated from protobuf field .google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16; + * @param \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata $var + * @return $this + */ + public function setBatchPredictDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Details of ExportData operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + * @return \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata|null + */ + public function getExportDataDetails() + { + return $this->readOneof(21); + } + + public function hasExportDataDetails() + { + return $this->hasOneof(21); + } + + /** + * Details of ExportData operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21; + * @param \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata $var + * @return $this + */ + public function setExportDataDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata::class); + $this->writeOneof(21, $var); + + return $this; + } + + /** + * Details of ExportModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + * @return \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata|null + */ + public function getExportModelDetails() + { + return $this->readOneof(22); + } + + public function hasExportModelDetails() + { + return $this->hasOneof(22); + } + + /** + * Details of ExportModel operation. + * + * Generated from protobuf field .google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22; + * @param \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata $var + * @return $this + */ + public function setExportModelDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Output only. Progress of operation. Range: [0, 100]. + * Not used currently. + * + * Generated from protobuf field int32 progress_percent = 13; + * @return int + */ + public function getProgressPercent() + { + return $this->progress_percent; + } + + /** + * Output only. Progress of operation. Range: [0, 100]. + * Not used currently. + * + * Generated from protobuf field int32 progress_percent = 13; + * @param int $var + * @return $this + */ + public function setProgressPercent($var) + { + GPBUtil::checkInt32($var); + $this->progress_percent = $var; + + return $this; + } + + /** + * Output only. Partial failures encountered. + * E.g. single files that couldn't be read. + * This field should never exceed 20 entries. + * Status details field will contain standard GCP error details. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPartialFailures() + { + return $this->partial_failures; + } + + /** + * Output only. Partial failures encountered. + * E.g. single files that couldn't be read. + * This field should never exceed 20 entries. + * Status details field will contain standard GCP error details. + * + * Generated from protobuf field repeated .google.rpc.Status partial_failures = 2; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPartialFailures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->partial_failures = $arr; + + return $this; + } + + /** + * Output only. Time when the operation was created. + * + * 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); + } + + /** + * Output only. Time when the operation was created. + * + * 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; + } + + /** + * Output only. Time when the operation was updated for the last time. + * + * 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); + } + + /** + * Output only. Time when the operation was updated for the last time. + * + * 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; + } + + /** + * @return string + */ + public function getDetails() + { + return $this->whichOneof("details"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OutputConfig.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OutputConfig.php new file mode 100644 index 000000000000..72789ddf8aad --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/OutputConfig.php @@ -0,0 +1,119 @@ +_` + * where will be made + * BigQuery-dataset-name compatible (e.g. most special characters will + * become underscores), and timestamp will be in + * YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that + * dataset a new table called `primary_table` will be created, and + * filled with precisely the same data as this obtained on import. + * + * Generated from protobuf message google.cloud.automl.v1.OutputConfig + */ +class OutputConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\GcsDestination $gcs_destination + * Required. The Google Cloud Storage location where the output is to be + * written to. For Image Object Detection, Text Extraction, Video + * Classification and Tables, in the given directory a new directory will be + * created with name: + * export_data-- where + * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + * output will be written into that directory. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Io::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Google Cloud Storage location where the output is to be + * written to. For Image Object Detection, Text Extraction, Video + * Classification and Tables, in the given directory a new directory will be + * created with name: + * export_data-- where + * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + * output will be written into that directory. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(1); + } + + public function hasGcsDestination() + { + return $this->hasOneof(1); + } + + /** + * Required. The Google Cloud Storage location where the output is to be + * written to. For Image Object Detection, Text Extraction, Video + * Classification and Tables, in the given directory a new directory will be + * created with name: + * export_data-- where + * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + * output will be written into that directory. + * + * Generated from protobuf field .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\GcsDestination::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictRequest.php new file mode 100644 index 000000000000..fe8b74d90ec0 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictRequest.php @@ -0,0 +1,285 @@ +google.cloud.automl.v1.PredictRequest + */ +class PredictRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the model requested to serve the prediction. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $payload = null; + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * + * Generated from protobuf field map params = 3; + */ + private $params; + + /** + * @param string $name Required. Name of the model requested to serve the prediction. Please see + * {@see PredictionServiceClient::modelName()} for help formatting this field. + * @param \Google\Cloud\AutoMl\V1\ExamplePayload $payload Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * @param array $params Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * + * AutoML Vision Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * + * AutoML Vision Object Detection + * + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * + * AutoML Tables + * + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * + * @return \Google\Cloud\AutoMl\V1\PredictRequest + * + * @experimental + */ + public static function build(string $name, \Google\Cloud\AutoMl\V1\ExamplePayload $payload, array $params): self + { + return (new self()) + ->setName($name) + ->setPayload($payload) + ->setParams($params); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the model requested to serve the prediction. + * @type \Google\Cloud\AutoMl\V1\ExamplePayload $payload + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * @type array|\Google\Protobuf\Internal\MapField $params + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the model requested to serve the prediction. + * + * 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. Name of the model requested to serve the prediction. + * + * 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; + } + + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\ExamplePayload|null + */ + public function getPayload() + { + return $this->payload; + } + + public function hasPayload() + { + return isset($this->payload); + } + + public function clearPayload() + { + unset($this->payload); + } + + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload payload = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\ExamplePayload $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExamplePayload::class); + $this->payload = $var; + + return $this; + } + + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * + * Generated from protobuf field map params = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + * is populated in the returned list of + * [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + * objects. The default is false. + * + * Generated from protobuf field map params = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->params = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictResponse.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictResponse.php new file mode 100644 index 000000000000..e87737cc5e77 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/PredictResponse.php @@ -0,0 +1,229 @@ +google.cloud.automl.v1.PredictResponse + */ +class PredictResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Prediction result. + * AutoML Translation and AutoML Natural Language Sentiment Analysis + * return precisely one payload. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + */ + private $payload; + /** + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * For AutoML Natural Language (Classification, Entity Extraction, and + * Sentiment Analysis), if the input is a document, the recognized text is + * returned in the + * [document_text][google.cloud.automl.v1.Document.document_text] + * property. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + */ + protected $preprocessed_input = null; + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes to return per image. + * AutoML Natural Language Sentiment Analysis + * `sentiment_score` + * : (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 is also positive (though + * the least). + * `sentiment_score` is not the same as "score" and "magnitude" + * from Sentiment Analysis in the Natural Language API. + * + * Generated from protobuf field map metadata = 2; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AutoMl\V1\AnnotationPayload>|\Google\Protobuf\Internal\RepeatedField $payload + * Prediction result. + * AutoML Translation and AutoML Natural Language Sentiment Analysis + * return precisely one payload. + * @type \Google\Cloud\AutoMl\V1\ExamplePayload $preprocessed_input + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * For AutoML Natural Language (Classification, Entity Extraction, and + * Sentiment Analysis), if the input is a document, the recognized text is + * returned in the + * [document_text][google.cloud.automl.v1.Document.document_text] + * property. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes to return per image. + * AutoML Natural Language Sentiment Analysis + * `sentiment_score` + * : (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 is also positive (though + * the least). + * `sentiment_score` is not the same as "score" and "magnitude" + * from Sentiment Analysis in the Natural Language API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Prediction result. + * AutoML Translation and AutoML Natural Language Sentiment Analysis + * return precisely one payload. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPayload() + { + return $this->payload; + } + + /** + * Prediction result. + * AutoML Translation and AutoML Natural Language Sentiment Analysis + * return precisely one payload. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.AnnotationPayload payload = 1; + * @param array<\Google\Cloud\AutoMl\V1\AnnotationPayload>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPayload($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\AnnotationPayload::class); + $this->payload = $arr; + + return $this; + } + + /** + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * For AutoML Natural Language (Classification, Entity Extraction, and + * Sentiment Analysis), if the input is a document, the recognized text is + * returned in the + * [document_text][google.cloud.automl.v1.Document.document_text] + * property. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + * @return \Google\Cloud\AutoMl\V1\ExamplePayload|null + */ + public function getPreprocessedInput() + { + return $this->preprocessed_input; + } + + public function hasPreprocessedInput() + { + return isset($this->preprocessed_input); + } + + public function clearPreprocessedInput() + { + unset($this->preprocessed_input); + } + + /** + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * For AutoML Natural Language (Classification, Entity Extraction, and + * Sentiment Analysis), if the input is a document, the recognized text is + * returned in the + * [document_text][google.cloud.automl.v1.Document.document_text] + * property. + * + * Generated from protobuf field .google.cloud.automl.v1.ExamplePayload preprocessed_input = 3; + * @param \Google\Cloud\AutoMl\V1\ExamplePayload $var + * @return $this + */ + public function setPreprocessedInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExamplePayload::class); + $this->preprocessed_input = $var; + + return $this; + } + + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes to return per image. + * AutoML Natural Language Sentiment Analysis + * `sentiment_score` + * : (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 is also positive (though + * the least). + * `sentiment_score` is not the same as "score" and "magnitude" + * from Sentiment Analysis in the Natural Language API. + * + * Generated from protobuf field map metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Additional domain-specific prediction response metadata. + * AutoML Vision Object Detection + * `max_bounding_box_count` + * : (int64) The maximum number of bounding boxes to return per image. + * AutoML Natural Language Sentiment Analysis + * `sentiment_score` + * : (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 is also positive (though + * the least). + * `sentiment_score` is not the same as "score" and "magnitude" + * from Sentiment Analysis in the Natural Language API. + * + * Generated from protobuf field map metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationDatasetMetadata.php new file mode 100644 index 000000000000..d174bc8d04a8 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationDatasetMetadata.php @@ -0,0 +1,67 @@ +google.cloud.automl.v1.TextClassificationDatasetMetadata + */ +class TextClassificationDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1; + */ + protected $classification_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $classification_type + * Required. Type of the classification problem. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1; + * @return int + */ + public function getClassificationType() + { + return $this->classification_type; + } + + /** + * Required. Type of the classification problem. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 1; + * @param int $var + * @return $this + */ + public function setClassificationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\ClassificationType::class); + $this->classification_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationModelMetadata.php new file mode 100644 index 000000000000..2d1a81c94f42 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextClassificationModelMetadata.php @@ -0,0 +1,67 @@ +google.cloud.automl.v1.TextClassificationModelMetadata + */ +class TextClassificationModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Classification type of the dataset used to train this model. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 3; + */ + protected $classification_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $classification_type + * Output only. Classification type of the dataset used to train this model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Classification type of the dataset used to train this model. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 3; + * @return int + */ + public function getClassificationType() + { + return $this->classification_type; + } + + /** + * Output only. Classification type of the dataset used to train this model. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationType classification_type = 3; + * @param int $var + * @return $this + */ + public function setClassificationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AutoMl\V1\ClassificationType::class); + $this->classification_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionAnnotation.php new file mode 100644 index 000000000000..38691a3cc831 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionAnnotation.php @@ -0,0 +1,116 @@ +google.cloud.automl.v1.TextExtractionAnnotation + */ +class TextExtractionAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * + * Generated from protobuf field float score = 1; + */ + protected $score = 0.0; + protected $annotation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TextSegment $text_segment + * An entity annotation will set this, which is the part of the original + * text to which the annotation pertains. + * @type float $score + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextExtraction::initOnce(); + parent::__construct($data); + } + + /** + * An entity annotation will set this, which is the part of the original + * text to which the annotation pertains. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 3; + * @return \Google\Cloud\AutoMl\V1\TextSegment|null + */ + public function getTextSegment() + { + return $this->readOneof(3); + } + + public function hasTextSegment() + { + return $this->hasOneof(3); + } + + /** + * An entity annotation will set this, which is the part of the original + * text to which the annotation pertains. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSegment text_segment = 3; + * @param \Google\Cloud\AutoMl\V1\TextSegment $var + * @return $this + */ + public function setTextSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSegment::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * + * Generated from protobuf field float score = 1; + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * + * Generated from protobuf field float score = 1; + * @param float $var + * @return $this + */ + public function setScore($var) + { + GPBUtil::checkFloat($var); + $this->score = $var; + + return $this; + } + + /** + * @return string + */ + public function getAnnotation() + { + return $this->whichOneof("annotation"); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionDatasetMetadata.php new file mode 100644 index 000000000000..b6c10c7bd5f5 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionDatasetMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.TextExtractionDatasetMetadata + */ +class TextExtractionDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics.php new file mode 100644 index 000000000000..2acd2cd4824d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics.php @@ -0,0 +1,105 @@ +google.cloud.automl.v1.TextExtractionEvaluationMetrics + */ +class TextExtractionEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The Area under precision recall curve metric. + * + * Generated from protobuf field float au_prc = 1; + */ + protected $au_prc = 0.0; + /** + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + */ + private $confidence_metrics_entries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $au_prc + * Output only. The Area under precision recall curve metric. + * @type array<\Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $confidence_metrics_entries + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextExtraction::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The Area under precision recall curve metric. + * + * Generated from protobuf field float au_prc = 1; + * @return float + */ + public function getAuPrc() + { + return $this->au_prc; + } + + /** + * Output only. The Area under precision recall curve metric. + * + * Generated from protobuf field float au_prc = 1; + * @param float $var + * @return $this + */ + public function setAuPrc($var) + { + GPBUtil::checkFloat($var); + $this->au_prc = $var; + + return $this; + } + + /** + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConfidenceMetricsEntries() + { + return $this->confidence_metrics_entries; + } + + /** + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * + * Generated from protobuf field repeated .google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entries = 2; + * @param array<\Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics\ConfidenceMetricsEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConfidenceMetricsEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics\ConfidenceMetricsEntry::class); + $this->confidence_metrics_entries = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics/ConfidenceMetricsEntry.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics/ConfidenceMetricsEntry.php new file mode 100644 index 000000000000..8c833d3d60d6 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionEvaluationMetrics/ConfidenceMetricsEntry.php @@ -0,0 +1,180 @@ +google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + */ +class ConfidenceMetricsEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * + * Generated from protobuf field float confidence_threshold = 1; + */ + protected $confidence_threshold = 0.0; + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 3; + */ + protected $recall = 0.0; + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 4; + */ + protected $precision = 0.0; + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 5; + */ + protected $f1_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $confidence_threshold + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * @type float $recall + * Output only. Recall under the given confidence threshold. + * @type float $precision + * Output only. Precision under the given confidence threshold. + * @type float $f1_score + * Output only. The harmonic mean of recall and precision. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextExtraction::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * + * Generated from protobuf field float confidence_threshold = 1; + * @return float + */ + public function getConfidenceThreshold() + { + return $this->confidence_threshold; + } + + /** + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * + * Generated from protobuf field float confidence_threshold = 1; + * @param float $var + * @return $this + */ + public function setConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->confidence_threshold = $var; + + return $this; + } + + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 3; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Output only. Recall under the given confidence threshold. + * + * Generated from protobuf field float recall = 3; + * @param float $var + * @return $this + */ + public function setRecall($var) + { + GPBUtil::checkFloat($var); + $this->recall = $var; + + return $this; + } + + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 4; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Output only. Precision under the given confidence threshold. + * + * Generated from protobuf field float precision = 4; + * @param float $var + * @return $this + */ + public function setPrecision($var) + { + GPBUtil::checkFloat($var); + $this->precision = $var; + + return $this; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 5; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 5; + * @param float $var + * @return $this + */ + public function setF1Score($var) + { + GPBUtil::checkFloat($var); + $this->f1_score = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfidenceMetricsEntry::class, \Google\Cloud\AutoMl\V1\TextExtractionEvaluationMetrics_ConfidenceMetricsEntry::class); + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionModelMetadata.php new file mode 100644 index 000000000000..cdc4f068d268 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextExtractionModelMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.TextExtractionModelMetadata + */ +class TextExtractionModelMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSegment.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSegment.php new file mode 100644 index 000000000000..9ccbf189ab85 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSegment.php @@ -0,0 +1,147 @@ +google.cloud.automl.v1.TextSegment + */ +class TextSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The content of the TextSegment. + * + * Generated from protobuf field string content = 3; + */ + protected $content = ''; + /** + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * + * Generated from protobuf field int64 start_offset = 1; + */ + protected $start_offset = 0; + /** + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * + * Generated from protobuf field int64 end_offset = 2; + */ + protected $end_offset = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Output only. The content of the TextSegment. + * @type int|string $start_offset + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * @type int|string $end_offset + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextSegment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The content of the TextSegment. + * + * Generated from protobuf field string content = 3; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Output only. The content of the TextSegment. + * + * 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; + } + + /** + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * + * Generated from protobuf field int64 start_offset = 1; + * @return int|string + */ + public function getStartOffset() + { + return $this->start_offset; + } + + /** + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * + * Generated from protobuf field int64 start_offset = 1; + * @param int|string $var + * @return $this + */ + public function setStartOffset($var) + { + GPBUtil::checkInt64($var); + $this->start_offset = $var; + + return $this; + } + + /** + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * + * Generated from protobuf field int64 end_offset = 2; + * @return int|string + */ + public function getEndOffset() + { + return $this->end_offset; + } + + /** + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * + * Generated from protobuf field int64 end_offset = 2; + * @param int|string $var + * @return $this + */ + public function setEndOffset($var) + { + GPBUtil::checkInt64($var); + $this->end_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentAnnotation.php new file mode 100644 index 000000000000..1c95dbd25468 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentAnnotation.php @@ -0,0 +1,111 @@ +google.cloud.automl.v1.TextSentimentAnnotation + */ +class TextSentimentAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The sentiment with the semantic, as given to the + * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + * for the prediction had been trained. + * The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * + * Generated from protobuf field int32 sentiment = 1; + */ + protected $sentiment = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $sentiment + * Output only. The sentiment with the semantic, as given to the + * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + * for the prediction had been trained. + * The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextSentiment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The sentiment with the semantic, as given to the + * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + * for the prediction had been trained. + * The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * + * Generated from protobuf field int32 sentiment = 1; + * @return int + */ + public function getSentiment() + { + return $this->sentiment; + } + + /** + * Output only. The sentiment with the semantic, as given to the + * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + * for the prediction had been trained. + * The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * + * Generated from protobuf field int32 sentiment = 1; + * @param int $var + * @return $this + */ + public function setSentiment($var) + { + GPBUtil::checkInt32($var); + $this->sentiment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentDatasetMetadata.php new file mode 100644 index 000000000000..352d7dfd4d45 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentDatasetMetadata.php @@ -0,0 +1,87 @@ +google.cloud.automl.v1.TextSentimentDatasetMetadata + */ +class TextSentimentDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A sentiment is expressed as an integer ordinal, where higher value + * means a more positive sentiment. The range of sentiments that will be used + * is between 0 and sentiment_max (inclusive on both ends), and all the values + * in the range must be represented in the dataset before a model can be + * created. + * sentiment_max value must be between 1 and 10 (inclusive). + * + * Generated from protobuf field int32 sentiment_max = 1; + */ + protected $sentiment_max = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $sentiment_max + * Required. A sentiment is expressed as an integer ordinal, where higher value + * means a more positive sentiment. The range of sentiments that will be used + * is between 0 and sentiment_max (inclusive on both ends), and all the values + * in the range must be represented in the dataset before a model can be + * created. + * sentiment_max value must be between 1 and 10 (inclusive). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + + /** + * Required. A sentiment is expressed as an integer ordinal, where higher value + * means a more positive sentiment. The range of sentiments that will be used + * is between 0 and sentiment_max (inclusive on both ends), and all the values + * in the range must be represented in the dataset before a model can be + * created. + * sentiment_max value must be between 1 and 10 (inclusive). + * + * Generated from protobuf field int32 sentiment_max = 1; + * @return int + */ + public function getSentimentMax() + { + return $this->sentiment_max; + } + + /** + * Required. A sentiment is expressed as an integer ordinal, where higher value + * means a more positive sentiment. The range of sentiments that will be used + * is between 0 and sentiment_max (inclusive on both ends), and all the values + * in the range must be represented in the dataset before a model can be + * created. + * sentiment_max value must be between 1 and 10 (inclusive). + * + * Generated from protobuf field int32 sentiment_max = 1; + * @param int $var + * @return $this + */ + public function setSentimentMax($var) + { + GPBUtil::checkInt32($var); + $this->sentiment_max = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentEvaluationMetrics.php new file mode 100644 index 000000000000..3d45752c0090 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentEvaluationMetrics.php @@ -0,0 +1,339 @@ +google.cloud.automl.v1.TextSentimentEvaluationMetrics + */ +class TextSentimentEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Precision. + * + * Generated from protobuf field float precision = 1; + */ + protected $precision = 0.0; + /** + * Output only. Recall. + * + * Generated from protobuf field float recall = 2; + */ + protected $recall = 0.0; + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 3; + */ + protected $f1_score = 0.0; + /** + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_absolute_error = 4; + */ + protected $mean_absolute_error = 0.0; + /** + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_squared_error = 5; + */ + protected $mean_squared_error = 0.0; + /** + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float linear_kappa = 6; + */ + protected $linear_kappa = 0.0; + /** + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float quadratic_kappa = 7; + */ + protected $quadratic_kappa = 0.0; + /** + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + */ + protected $confusion_matrix = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $precision + * Output only. Precision. + * @type float $recall + * Output only. Recall. + * @type float $f1_score + * Output only. The harmonic mean of recall and precision. + * @type float $mean_absolute_error + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * @type float $mean_squared_error + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * @type float $linear_kappa + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * @type float $quadratic_kappa + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * @type \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix $confusion_matrix + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\TextSentiment::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Precision. + * + * Generated from protobuf field float precision = 1; + * @return float + */ + public function getPrecision() + { + return $this->precision; + } + + /** + * Output only. 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; + } + + /** + * Output only. Recall. + * + * Generated from protobuf field float recall = 2; + * @return float + */ + public function getRecall() + { + return $this->recall; + } + + /** + * Output only. 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; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * Generated from protobuf field float f1_score = 3; + * @return float + */ + public function getF1Score() + { + return $this->f1_score; + } + + /** + * Output only. The harmonic mean of recall and precision. + * + * 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; + } + + /** + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_absolute_error = 4; + * @return float + */ + public function getMeanAbsoluteError() + { + return $this->mean_absolute_error; + } + + /** + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_absolute_error = 4; + * @param float $var + * @return $this + */ + public function setMeanAbsoluteError($var) + { + GPBUtil::checkFloat($var); + $this->mean_absolute_error = $var; + + return $this; + } + + /** + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_squared_error = 5; + * @return float + */ + public function getMeanSquaredError() + { + return $this->mean_squared_error; + } + + /** + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float mean_squared_error = 5; + * @param float $var + * @return $this + */ + public function setMeanSquaredError($var) + { + GPBUtil::checkFloat($var); + $this->mean_squared_error = $var; + + return $this; + } + + /** + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float linear_kappa = 6; + * @return float + */ + public function getLinearKappa() + { + return $this->linear_kappa; + } + + /** + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float linear_kappa = 6; + * @param float $var + * @return $this + */ + public function setLinearKappa($var) + { + GPBUtil::checkFloat($var); + $this->linear_kappa = $var; + + return $this; + } + + /** + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float quadratic_kappa = 7; + * @return float + */ + public function getQuadraticKappa() + { + return $this->quadratic_kappa; + } + + /** + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * Generated from protobuf field float quadratic_kappa = 7; + * @param float $var + * @return $this + */ + public function setQuadraticKappa($var) + { + GPBUtil::checkFloat($var); + $this->quadratic_kappa = $var; + + return $this; + } + + /** + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * @return \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix|null + */ + public function getConfusionMatrix() + { + return $this->confusion_matrix; + } + + public function hasConfusionMatrix() + { + return isset($this->confusion_matrix); + } + + public function clearConfusionMatrix() + { + unset($this->confusion_matrix); + } + + /** + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * + * Generated from protobuf field .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + * @param \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix $var + * @return $this + */ + public function setConfusionMatrix($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ClassificationEvaluationMetrics\ConfusionMatrix::class); + $this->confusion_matrix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentModelMetadata.php new file mode 100644 index 000000000000..67524cbc7e25 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSentimentModelMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.TextSentimentModelMetadata + */ +class TextSentimentModelMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Text::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSnippet.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSnippet.php new file mode 100644 index 000000000000..0ddb5bffe51f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TextSnippet.php @@ -0,0 +1,147 @@ +google.cloud.automl.v1.TextSnippet + */ +class TextSnippet extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The content of the text snippet as a string. Up to 250000 + * characters long. + * + * Generated from protobuf field string content = 1; + */ + protected $content = ''; + /** + * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + * values are "text/html" and "text/plain". If left blank, the format is + * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + * + * Generated from protobuf field string mime_type = 2; + */ + protected $mime_type = ''; + /** + * Output only. HTTP URI where you can download the content. + * + * Generated from protobuf field string content_uri = 4; + */ + protected $content_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * Required. The content of the text snippet as a string. Up to 250000 + * characters long. + * @type string $mime_type + * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + * values are "text/html" and "text/plain". If left blank, the format is + * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + * @type string $content_uri + * Output only. HTTP URI where you can download the content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\DataItems::initOnce(); + parent::__construct($data); + } + + /** + * Required. The content of the text snippet as a string. Up to 250000 + * characters long. + * + * Generated from protobuf field string content = 1; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Required. The content of the text snippet as a string. Up to 250000 + * characters long. + * + * Generated from protobuf field string content = 1; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + * values are "text/html" and "text/plain". If left blank, the format is + * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + * + * Generated from protobuf field string mime_type = 2; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + * values are "text/html" and "text/plain". If left blank, the format is + * automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.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; + } + + /** + * Output only. HTTP URI where you can download the content. + * + * Generated from protobuf field string content_uri = 4; + * @return string + */ + public function getContentUri() + { + return $this->content_uri; + } + + /** + * Output only. HTTP URI where you can download the content. + * + * Generated from protobuf field string content_uri = 4; + * @param string $var + * @return $this + */ + public function setContentUri($var) + { + GPBUtil::checkString($var, True); + $this->content_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationAnnotation.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationAnnotation.php new file mode 100644 index 000000000000..f0331be6b72b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationAnnotation.php @@ -0,0 +1,77 @@ +google.cloud.automl.v1.TranslationAnnotation + */ +class TranslationAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only . The translated content. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet translated_content = 1; + */ + protected $translated_content = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\TextSnippet $translated_content + * Output only . The translated content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Translation::initOnce(); + parent::__construct($data); + } + + /** + * Output only . The translated content. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet translated_content = 1; + * @return \Google\Cloud\AutoMl\V1\TextSnippet|null + */ + public function getTranslatedContent() + { + return $this->translated_content; + } + + public function hasTranslatedContent() + { + return isset($this->translated_content); + } + + public function clearTranslatedContent() + { + unset($this->translated_content); + } + + /** + * Output only . The translated content. + * + * Generated from protobuf field .google.cloud.automl.v1.TextSnippet translated_content = 1; + * @param \Google\Cloud\AutoMl\V1\TextSnippet $var + * @return $this + */ + public function setTranslatedContent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\TextSnippet::class); + $this->translated_content = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationDatasetMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationDatasetMetadata.php new file mode 100644 index 000000000000..37554063e8e1 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationDatasetMetadata.php @@ -0,0 +1,101 @@ +google.cloud.automl.v1.TranslationDatasetMetadata + */ +class TranslationDatasetMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The BCP-47 language code of the source language. + * + * Generated from protobuf field string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $source_language_code = ''; + /** + * Required. The BCP-47 language code of the target language. + * + * Generated from protobuf field string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source_language_code + * Required. The BCP-47 language code of the source language. + * @type string $target_language_code + * Required. The BCP-47 language code of the target language. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Translation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The BCP-47 language code of the source language. + * + * Generated from protobuf field string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSourceLanguageCode() + { + return $this->source_language_code; + } + + /** + * Required. The BCP-47 language code of the source language. + * + * Generated from protobuf field string source_language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSourceLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->source_language_code = $var; + + return $this; + } + + /** + * Required. The BCP-47 language code of the target language. + * + * Generated from protobuf field string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetLanguageCode() + { + return $this->target_language_code; + } + + /** + * Required. The BCP-47 language code of the target language. + * + * Generated from protobuf field string target_language_code = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->target_language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationEvaluationMetrics.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationEvaluationMetrics.php new file mode 100644 index 000000000000..824df4fb470d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationEvaluationMetrics.php @@ -0,0 +1,101 @@ +google.cloud.automl.v1.TranslationEvaluationMetrics + */ +class TranslationEvaluationMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. BLEU score. + * + * Generated from protobuf field double bleu_score = 1; + */ + protected $bleu_score = 0.0; + /** + * Output only. BLEU score for base model. + * + * Generated from protobuf field double base_bleu_score = 2; + */ + protected $base_bleu_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $bleu_score + * Output only. BLEU score. + * @type float $base_bleu_score + * Output only. BLEU score for base model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Translation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. BLEU score. + * + * Generated from protobuf field double bleu_score = 1; + * @return float + */ + public function getBleuScore() + { + return $this->bleu_score; + } + + /** + * Output only. BLEU score. + * + * Generated from protobuf field double bleu_score = 1; + * @param float $var + * @return $this + */ + public function setBleuScore($var) + { + GPBUtil::checkDouble($var); + $this->bleu_score = $var; + + return $this; + } + + /** + * Output only. BLEU score for base model. + * + * Generated from protobuf field double base_bleu_score = 2; + * @return float + */ + public function getBaseBleuScore() + { + return $this->base_bleu_score; + } + + /** + * Output only. BLEU score for base model. + * + * Generated from protobuf field double base_bleu_score = 2; + * @param float $var + * @return $this + */ + public function setBaseBleuScore($var) + { + GPBUtil::checkDouble($var); + $this->base_bleu_score = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationModelMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationModelMetadata.php new file mode 100644 index 000000000000..7271f3e10913 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/TranslationModelMetadata.php @@ -0,0 +1,155 @@ +google.cloud.automl.v1.TranslationModelMetadata + */ +class TranslationModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the model to use as a baseline to train the custom + * model. If unset, we use the default base model provided by Google + * Translate. Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string base_model = 1; + */ + protected $base_model = ''; + /** + * Output only. Inferred from the dataset. + * The source language (The BCP-47 language code) that is used for training. + * + * Generated from protobuf field string source_language_code = 2; + */ + protected $source_language_code = ''; + /** + * Output only. The target language (The BCP-47 language code) that is used + * for training. + * + * Generated from protobuf field string target_language_code = 3; + */ + protected $target_language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $base_model + * The resource name of the model to use as a baseline to train the custom + * model. If unset, we use the default base model provided by Google + * Translate. Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}` + * @type string $source_language_code + * Output only. Inferred from the dataset. + * The source language (The BCP-47 language code) that is used for training. + * @type string $target_language_code + * Output only. The target language (The BCP-47 language code) that is used + * for training. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Translation::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the model to use as a baseline to train the custom + * model. If unset, we use the default base model provided by Google + * Translate. Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string base_model = 1; + * @return string + */ + public function getBaseModel() + { + return $this->base_model; + } + + /** + * The resource name of the model to use as a baseline to train the custom + * model. If unset, we use the default base model provided by Google + * Translate. Format: + * `projects/{project_id}/locations/{location_id}/models/{model_id}` + * + * Generated from protobuf field string base_model = 1; + * @param string $var + * @return $this + */ + public function setBaseModel($var) + { + GPBUtil::checkString($var, True); + $this->base_model = $var; + + return $this; + } + + /** + * Output only. Inferred from the dataset. + * The source language (The BCP-47 language code) that is used for training. + * + * Generated from protobuf field string source_language_code = 2; + * @return string + */ + public function getSourceLanguageCode() + { + return $this->source_language_code; + } + + /** + * Output only. Inferred from the dataset. + * The source language (The BCP-47 language code) that is used for training. + * + * Generated from protobuf field string source_language_code = 2; + * @param string $var + * @return $this + */ + public function setSourceLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->source_language_code = $var; + + return $this; + } + + /** + * Output only. The target language (The BCP-47 language code) that is used + * for training. + * + * Generated from protobuf field string target_language_code = 3; + * @return string + */ + public function getTargetLanguageCode() + { + return $this->target_language_code; + } + + /** + * Output only. The target language (The BCP-47 language code) that is used + * for training. + * + * Generated from protobuf field string target_language_code = 3; + * @param string $var + * @return $this + */ + public function setTargetLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->target_language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelOperationMetadata.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelOperationMetadata.php new file mode 100644 index 000000000000..437d6e00c14c --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelOperationMetadata.php @@ -0,0 +1,33 @@ +google.cloud.automl.v1.UndeployModelOperationMetadata + */ +class UndeployModelOperationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelRequest.php new file mode 100644 index 000000000000..fc39415291db --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UndeployModelRequest.php @@ -0,0 +1,81 @@ +google.cloud.automl.v1.UndeployModelRequest + */ +class UndeployModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the model to undeploy. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of the model to undeploy. Please see + * {@see AutoMlClient::modelName()} for help formatting this field. + * + * @return \Google\Cloud\AutoMl\V1\UndeployModelRequest + * + * @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. Resource name of the model to undeploy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the model to undeploy. + * + * 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. Resource name of the model to undeploy. + * + * 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/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateDatasetRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateDatasetRequest.php new file mode 100644 index 000000000000..2beb23764837 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateDatasetRequest.php @@ -0,0 +1,136 @@ +google.cloud.automl.v1.UpdateDatasetRequest + */ +class UpdateDatasetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The dataset which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset = null; + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\AutoMl\V1\Dataset $dataset Required. The dataset which replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. + * + * @return \Google\Cloud\AutoMl\V1\UpdateDatasetRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AutoMl\V1\Dataset $dataset, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataset($dataset) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\Dataset $dataset + * Required. The dataset which replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The dataset which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\Dataset|null + */ + public function getDataset() + { + return $this->dataset; + } + + public function hasDataset() + { + return isset($this->dataset); + } + + public function clearDataset() + { + unset($this->dataset); + } + + /** + * Required. The dataset which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\Dataset $var + * @return $this + */ + public function setDataset($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Dataset::class); + $this->dataset = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateModelRequest.php b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateModelRequest.php new file mode 100644 index 000000000000..0408ab2efb2a --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/proto/src/Google/Cloud/AutoMl/V1/UpdateModelRequest.php @@ -0,0 +1,136 @@ +google.cloud.automl.v1.UpdateModelRequest + */ +class UpdateModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The model which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $model = null; + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\AutoMl\V1\Model $model Required. The model which replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. + * + * @return \Google\Cloud\AutoMl\V1\UpdateModelRequest + * + * @experimental + */ + public static function build(\Google\Cloud\AutoMl\V1\Model $model, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setModel($model) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AutoMl\V1\Model $model + * Required. The model which replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Automl\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The model which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\AutoMl\V1\Model|null + */ + public function getModel() + { + return $this->model; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Required. The model which replaces the resource on the server. + * + * Generated from protobuf field .google.cloud.automl.v1.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\AutoMl\V1\Model $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\Model::class); + $this->model = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The update mask applies to the resource. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_dataset.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_dataset.php new file mode 100644 index 000000000000..d0614e92c97e --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_dataset.php @@ -0,0 +1,85 @@ +setParent($formattedParent) + ->setDataset($dataset); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->createDataset($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Dataset $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 = AutoMlClient::locationName('[PROJECT]', '[LOCATION]'); + + create_dataset_sample($formattedParent); +} +// [END automl_v1_generated_AutoMl_CreateDataset_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_model.php new file mode 100644 index 000000000000..69f95a54b186 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/create_model.php @@ -0,0 +1,89 @@ +setParent($formattedParent) + ->setModel($model); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->createModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Model $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 = AutoMlClient::locationName('[PROJECT]', '[LOCATION]'); + + create_model_sample($formattedParent); +} +// [END automl_v1_generated_AutoMl_CreateModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_dataset.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_dataset.php new file mode 100644 index 000000000000..cc27e08bc16d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_dataset.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->deleteDataset($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 = AutoMlClient::datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + + delete_dataset_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_DeleteDataset_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_model.php new file mode 100644 index 000000000000..51ad90525937 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/delete_model.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->deleteModel($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 = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + delete_model_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_DeleteModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/deploy_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/deploy_model.php new file mode 100644 index 000000000000..342e9a950952 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/deploy_model.php @@ -0,0 +1,90 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->deployModel($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 = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + deploy_model_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_DeployModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_data.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_data.php new file mode 100644 index 000000000000..28d17822fa67 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_data.php @@ -0,0 +1,98 @@ +setOutputUriPrefix($outputConfigGcsDestinationOutputUriPrefix); + $outputConfig = (new OutputConfig()) + ->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportDataRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->exportData($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 = AutoMlClient::datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $outputConfigGcsDestinationOutputUriPrefix = '[OUTPUT_URI_PREFIX]'; + + export_data_sample($formattedName, $outputConfigGcsDestinationOutputUriPrefix); +} +// [END automl_v1_generated_AutoMl_ExportData_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_model.php new file mode 100644 index 000000000000..d482584b3b8a --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/export_model.php @@ -0,0 +1,102 @@ +setOutputUriPrefix($outputConfigGcsDestinationOutputUriPrefix); + $outputConfig = (new ModelExportOutputConfig()) + ->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportModelRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->exportModel($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 = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $outputConfigGcsDestinationOutputUriPrefix = '[OUTPUT_URI_PREFIX]'; + + export_model_sample($formattedName, $outputConfigGcsDestinationOutputUriPrefix); +} +// [END automl_v1_generated_AutoMl_ExportModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_annotation_spec.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_annotation_spec.php new file mode 100644 index 000000000000..52a862870be4 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_annotation_spec.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AnnotationSpec $response */ + $response = $autoMlClient->getAnnotationSpec($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 = AutoMlClient::annotationSpecName( + '[PROJECT]', + '[LOCATION]', + '[DATASET]', + '[ANNOTATION_SPEC]' + ); + + get_annotation_spec_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_GetAnnotationSpec_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_dataset.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_dataset.php new file mode 100644 index 000000000000..664f48931c27 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_dataset.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Dataset $response */ + $response = $autoMlClient->getDataset($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 = AutoMlClient::datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + + get_dataset_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_GetDataset_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model.php new file mode 100644 index 000000000000..9f35305c88cf --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Model $response */ + $response = $autoMlClient->getModel($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 = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + get_model_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_GetModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model_evaluation.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model_evaluation.php new file mode 100644 index 000000000000..fd11ecf2cec8 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/get_model_evaluation.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ModelEvaluation $response */ + $response = $autoMlClient->getModelEvaluation($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 = AutoMlClient::modelEvaluationName( + '[PROJECT]', + '[LOCATION]', + '[MODEL]', + '[MODEL_EVALUATION]' + ); + + get_model_evaluation_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_GetModelEvaluation_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/import_data.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/import_data.php new file mode 100644 index 000000000000..561944ff9b65 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/import_data.php @@ -0,0 +1,92 @@ +setName($formattedName) + ->setInputConfig($inputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->importData($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 = AutoMlClient::datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + + import_data_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_ImportData_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_datasets.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_datasets.php new file mode 100644 index 000000000000..d33650ae5385 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_datasets.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $autoMlClient->listDatasets($request); + + /** @var Dataset $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 = AutoMlClient::locationName('[PROJECT]', '[LOCATION]'); + + list_datasets_sample($formattedParent); +} +// [END automl_v1_generated_AutoMl_ListDatasets_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_model_evaluations.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_model_evaluations.php new file mode 100644 index 000000000000..22972bcdd8ca --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_model_evaluations.php @@ -0,0 +1,91 @@ + The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + */ +function list_model_evaluations_sample(string $formattedParent, string $filter): void +{ + // Create a client. + $autoMlClient = new AutoMlClient(); + + // Prepare the request message. + $request = (new ListModelEvaluationsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $autoMlClient->listModelEvaluations($request); + + /** @var ModelEvaluation $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 = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $filter = '[FILTER]'; + + list_model_evaluations_sample($formattedParent, $filter); +} +// [END automl_v1_generated_AutoMl_ListModelEvaluations_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_models.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_models.php new file mode 100644 index 000000000000..dfe234500d3d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/list_models.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $autoMlClient->listModels($request); + + /** @var Model $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 = AutoMlClient::locationName('[PROJECT]', '[LOCATION]'); + + list_models_sample($formattedParent); +} +// [END automl_v1_generated_AutoMl_ListModels_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/undeploy_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/undeploy_model.php new file mode 100644 index 000000000000..8aac610a235b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/undeploy_model.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoMlClient->undeployModel($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 = AutoMlClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + undeploy_model_sample($formattedName); +} +// [END automl_v1_generated_AutoMl_UndeployModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_dataset.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_dataset.php new file mode 100644 index 000000000000..cb6d571bf1ec --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_dataset.php @@ -0,0 +1,62 @@ +setDataset($dataset) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Dataset $response */ + $response = $autoMlClient->updateDataset($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END automl_v1_generated_AutoMl_UpdateDataset_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_model.php b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_model.php new file mode 100644 index 000000000000..a04d31b68e67 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/AutoMlClient/update_model.php @@ -0,0 +1,62 @@ +setModel($model) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Model $response */ + $response = $autoMlClient->updateModel($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END automl_v1_generated_AutoMl_UpdateModel_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/batch_predict.php b/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/batch_predict.php new file mode 100644 index 000000000000..04e99da93e38 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/batch_predict.php @@ -0,0 +1,130 @@ +setInputUris($inputConfigGcsSourceInputUris); + $inputConfig = (new BatchPredictInputConfig()) + ->setGcsSource($inputConfigGcsSource); + $outputConfigGcsDestination = (new GcsDestination()) + ->setOutputUriPrefix($outputConfigGcsDestinationOutputUriPrefix); + $outputConfig = (new BatchPredictOutputConfig()) + ->setGcsDestination($outputConfigGcsDestination); + $request = (new BatchPredictRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $predictionServiceClient->batchPredict($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BatchPredictResult $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 = PredictionServiceClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $inputConfigGcsSourceInputUrisElement = '[INPUT_URIS]'; + $outputConfigGcsDestinationOutputUriPrefix = '[OUTPUT_URI_PREFIX]'; + + batch_predict_sample( + $formattedName, + $inputConfigGcsSourceInputUrisElement, + $outputConfigGcsDestinationOutputUriPrefix + ); +} +// [END automl_v1_generated_PredictionService_BatchPredict_sync] diff --git a/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/predict.php b/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/predict.php new file mode 100644 index 000000000000..ab9ba2bbea5f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/samples/V1/PredictionServiceClient/predict.php @@ -0,0 +1,109 @@ +setName($formattedName) + ->setPayload($payload); + + // Call the API and handle any network failures. + try { + /** @var PredictResponse $response */ + $response = $predictionServiceClient->predict($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 = PredictionServiceClient::modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + + predict_sample($formattedName); +} +// [END automl_v1_generated_PredictionService_Predict_sync] diff --git a/owl-bot-staging/AutoMl/v1/src/V1/Client/AutoMlClient.php b/owl-bot-staging/AutoMl/v1/src/V1/Client/AutoMlClient.php new file mode 100644 index 000000000000..fa18e426040b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/Client/AutoMlClient.php @@ -0,0 +1,912 @@ + createDatasetAsync(CreateDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface createModelAsync(CreateModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDatasetAsync(DeleteDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteModelAsync(DeleteModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface deployModelAsync(DeployModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportDataAsync(ExportDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportModelAsync(ExportModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAnnotationSpecAsync(GetAnnotationSpecRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDatasetAsync(GetDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface getModelAsync(GetModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getModelEvaluationAsync(GetModelEvaluationRequest $request, array $optionalArgs = []) + * @method PromiseInterface importDataAsync(ImportDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDatasetsAsync(ListDatasetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listModelEvaluationsAsync(ListModelEvaluationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listModelsAsync(ListModelsRequest $request, array $optionalArgs = []) + * @method PromiseInterface undeployModelAsync(UndeployModelRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDatasetAsync(UpdateDatasetRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateModelAsync(UpdateModelRequest $request, array $optionalArgs = []) + */ +final class AutoMlClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.automl.v1.AutoMl'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'automl.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'automl.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/auto_ml_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/auto_ml_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/auto_ml_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/auto_ml_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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * annotation_spec resource. + * + * @param string $project + * @param string $location + * @param string $dataset + * @param string $annotationSpec + * + * @return string The formatted annotation_spec resource. + */ + public static function annotationSpecName(string $project, string $location, string $dataset, string $annotationSpec): string + { + return self::getPathTemplate('annotationSpec')->render([ + 'project' => $project, + 'location' => $location, + 'dataset' => $dataset, + 'annotation_spec' => $annotationSpec, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a dataset + * resource. + * + * @param string $project + * @param string $location + * @param string $dataset + * + * @return string The formatted dataset resource. + */ + public static function datasetName(string $project, string $location, string $dataset): string + { + return self::getPathTemplate('dataset')->render([ + 'project' => $project, + 'location' => $location, + 'dataset' => $dataset, + ]); + } + + /** + * 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 model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * model_evaluation resource. + * + * @param string $project + * @param string $location + * @param string $model + * @param string $modelEvaluation + * + * @return string The formatted model_evaluation resource. + */ + public static function modelEvaluationName(string $project, string $location, string $model, string $modelEvaluation): string + { + return self::getPathTemplate('modelEvaluation')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + 'model_evaluation' => $modelEvaluation, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - annotationSpec: projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec} + * - dataset: projects/{project}/locations/{location}/datasets/{dataset} + * - location: projects/{project}/locations/{location} + * - model: projects/{project}/locations/{location}/models/{model} + * - modelEvaluation: projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation} + * + * 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 'automl.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); + } + + /** + * Creates a dataset. + * + * The async variant is {@see AutoMlClient::createDatasetAsync()} . + * + * @example samples/V1/AutoMlClient/create_dataset.php + * + * @param CreateDatasetRequest $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 createDataset(CreateDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateDataset', $request, $callOptions)->wait(); + } + + /** + * Creates a model. + * Returns a Model in the [response][google.longrunning.Operation.response] + * field when it completes. + * When you create a model, several model evaluations are created for it: + * a global evaluation, and one evaluation for each annotation spec. + * + * The async variant is {@see AutoMlClient::createModelAsync()} . + * + * @example samples/V1/AutoMlClient/create_model.php + * + * @param CreateModelRequest $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 createModel(CreateModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateModel', $request, $callOptions)->wait(); + } + + /** + * Deletes a dataset and all of its contents. + * Returns empty response in the + * [response][google.longrunning.Operation.response] field when it completes, + * and `delete_details` in the + * [metadata][google.longrunning.Operation.metadata] field. + * + * The async variant is {@see AutoMlClient::deleteDatasetAsync()} . + * + * @example samples/V1/AutoMlClient/delete_dataset.php + * + * @param DeleteDatasetRequest $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 deleteDataset(DeleteDatasetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteDataset', $request, $callOptions)->wait(); + } + + /** + * Deletes a model. + * Returns `google.protobuf.Empty` in the + * [response][google.longrunning.Operation.response] field when it completes, + * and `delete_details` in the + * [metadata][google.longrunning.Operation.metadata] field. + * + * The async variant is {@see AutoMlClient::deleteModelAsync()} . + * + * @example samples/V1/AutoMlClient/delete_model.php + * + * @param DeleteModelRequest $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 deleteModel(DeleteModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteModel', $request, $callOptions)->wait(); + } + + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + * deployment automatically. + * + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::deployModelAsync()} . + * + * @example samples/V1/AutoMlClient/deploy_model.php + * + * @param DeployModelRequest $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 deployModel(DeployModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeployModel', $request, $callOptions)->wait(); + } + + /** + * Exports dataset's data to the provided output location. + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::exportDataAsync()} . + * + * @example samples/V1/AutoMlClient/export_data.php + * + * @param ExportDataRequest $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 exportData(ExportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportData', $request, $callOptions)->wait(); + } + + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + * + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::exportModelAsync()} . + * + * @example samples/V1/AutoMlClient/export_model.php + * + * @param ExportModelRequest $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 exportModel(ExportModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportModel', $request, $callOptions)->wait(); + } + + /** + * Gets an annotation spec. + * + * The async variant is {@see AutoMlClient::getAnnotationSpecAsync()} . + * + * @example samples/V1/AutoMlClient/get_annotation_spec.php + * + * @param GetAnnotationSpecRequest $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 AnnotationSpec + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAnnotationSpec(GetAnnotationSpecRequest $request, array $callOptions = []): AnnotationSpec + { + return $this->startApiCall('GetAnnotationSpec', $request, $callOptions)->wait(); + } + + /** + * Gets a dataset. + * + * The async variant is {@see AutoMlClient::getDatasetAsync()} . + * + * @example samples/V1/AutoMlClient/get_dataset.php + * + * @param GetDatasetRequest $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 Dataset + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataset(GetDatasetRequest $request, array $callOptions = []): Dataset + { + return $this->startApiCall('GetDataset', $request, $callOptions)->wait(); + } + + /** + * Gets a model. + * + * The async variant is {@see AutoMlClient::getModelAsync()} . + * + * @example samples/V1/AutoMlClient/get_model.php + * + * @param GetModelRequest $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 Model + * + * @throws ApiException Thrown if the API call fails. + */ + public function getModel(GetModelRequest $request, array $callOptions = []): Model + { + return $this->startApiCall('GetModel', $request, $callOptions)->wait(); + } + + /** + * Gets a model evaluation. + * + * The async variant is {@see AutoMlClient::getModelEvaluationAsync()} . + * + * @example samples/V1/AutoMlClient/get_model_evaluation.php + * + * @param GetModelEvaluationRequest $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 ModelEvaluation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getModelEvaluation(GetModelEvaluationRequest $request, array $callOptions = []): ModelEvaluation + { + return $this->startApiCall('GetModelEvaluation', $request, $callOptions)->wait(); + } + + /** + * Imports data into a dataset. + * For Tables this method can only be called on an empty Dataset. + * + * For Tables: + * * A + * [schema_inference_version][google.cloud.automl.v1.InputConfig.params] + * parameter must be explicitly set. + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::importDataAsync()} . + * + * @example samples/V1/AutoMlClient/import_data.php + * + * @param ImportDataRequest $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 importData(ImportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportData', $request, $callOptions)->wait(); + } + + /** + * Lists datasets in a project. + * + * The async variant is {@see AutoMlClient::listDatasetsAsync()} . + * + * @example samples/V1/AutoMlClient/list_datasets.php + * + * @param ListDatasetsRequest $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 listDatasets(ListDatasetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDatasets', $request, $callOptions); + } + + /** + * Lists model evaluations. + * + * The async variant is {@see AutoMlClient::listModelEvaluationsAsync()} . + * + * @example samples/V1/AutoMlClient/list_model_evaluations.php + * + * @param ListModelEvaluationsRequest $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 listModelEvaluations(ListModelEvaluationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListModelEvaluations', $request, $callOptions); + } + + /** + * Lists models. + * + * The async variant is {@see AutoMlClient::listModelsAsync()} . + * + * @example samples/V1/AutoMlClient/list_models.php + * + * @param ListModelsRequest $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 listModels(ListModelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListModels', $request, $callOptions); + } + + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection and Tables; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * [response][google.longrunning.Operation.response] field when it completes. + * + * The async variant is {@see AutoMlClient::undeployModelAsync()} . + * + * @example samples/V1/AutoMlClient/undeploy_model.php + * + * @param UndeployModelRequest $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 undeployModel(UndeployModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UndeployModel', $request, $callOptions)->wait(); + } + + /** + * Updates a dataset. + * + * The async variant is {@see AutoMlClient::updateDatasetAsync()} . + * + * @example samples/V1/AutoMlClient/update_dataset.php + * + * @param UpdateDatasetRequest $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 Dataset + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDataset(UpdateDatasetRequest $request, array $callOptions = []): Dataset + { + return $this->startApiCall('UpdateDataset', $request, $callOptions)->wait(); + } + + /** + * Updates a model. + * + * The async variant is {@see AutoMlClient::updateModelAsync()} . + * + * @example samples/V1/AutoMlClient/update_model.php + * + * @param UpdateModelRequest $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 Model + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateModel(UpdateModelRequest $request, array $callOptions = []): Model + { + return $this->startApiCall('UpdateModel', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/AutoMl/v1/src/V1/Client/PredictionServiceClient.php b/owl-bot-staging/AutoMl/v1/src/V1/Client/PredictionServiceClient.php new file mode 100644 index 000000000000..0b1b2b5a05d4 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/Client/PredictionServiceClient.php @@ -0,0 +1,374 @@ + batchPredictAsync(BatchPredictRequest $request, array $optionalArgs = []) + * @method PromiseInterface predictAsync(PredictRequest $request, array $optionalArgs = []) + */ +final class PredictionServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.automl.v1.PredictionService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'automl.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'automl.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/prediction_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/prediction_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/prediction_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/prediction_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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a model + * resource. + * + * @param string $project + * @param string $location + * @param string $model + * + * @return string The formatted model resource. + */ + public static function modelName(string $project, string $location, string $model): string + { + return self::getPathTemplate('model')->render([ + 'project' => $project, + 'location' => $location, + 'model' => $model, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - model: projects/{project}/locations/{location}/models/{model} + * + * 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 'automl.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); + } + + /** + * Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch + * prediction result won't be immediately available in the response. Instead, + * a long running operation object is returned. User can poll the operation + * result via [GetOperation][google.longrunning.Operations.GetOperation] + * method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in + * the [response][google.longrunning.Operation.response] field. + * Available for following ML scenarios: + * + * * AutoML Vision Classification + * * AutoML Vision Object Detection + * * AutoML Video Intelligence Classification + * * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification + * * AutoML Natural Language Entity Extraction + * * AutoML Natural Language Sentiment Analysis + * * AutoML Tables + * + * The async variant is {@see PredictionServiceClient::batchPredictAsync()} . + * + * @example samples/V1/PredictionServiceClient/batch_predict.php + * + * @param BatchPredictRequest $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 batchPredict(BatchPredictRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BatchPredict', $request, $callOptions)->wait(); + } + + /** + * Perform an online prediction. The prediction result is directly + * returned in the response. + * Available for following ML scenarios, and their expected request payloads: + * + * AutoML Vision Classification + * + * * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + * + * AutoML Vision Object Detection + * + * * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + * + * AutoML Natural Language Classification + * + * * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + * .PDF, .TIF or .TIFF format with size upto 2MB. + * + * AutoML Natural Language Entity Extraction + * + * * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document + * in .PDF, .TIF or .TIFF format with size upto 20MB. + * + * AutoML Natural Language Sentiment Analysis + * + * * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + * .PDF, .TIF or .TIFF format with size upto 2MB. + * + * AutoML Translation + * + * * A TextSnippet up to 25,000 characters, UTF-8 encoded. + * + * AutoML Tables + * + * * A row with column values matching + * the columns of the model, up to 5MB. Not available for FORECASTING + * `prediction_type`. + * + * The async variant is {@see PredictionServiceClient::predictAsync()} . + * + * @example samples/V1/PredictionServiceClient/predict.php + * + * @param PredictRequest $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 PredictResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function predict(PredictRequest $request, array $callOptions = []): PredictResponse + { + return $this->startApiCall('Predict', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/AutoMl/v1/src/V1/gapic_metadata.json b/owl-bot-staging/AutoMl/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..0c6570bd7d8b --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/gapic_metadata.json @@ -0,0 +1,127 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.automl.v1", + "libraryPackage": "Google\\Cloud\\AutoMl\\V1", + "services": { + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceGapicClient", + "rpcs": { + "BatchPredict": { + "methods": [ + "batchPredict" + ] + }, + "Predict": { + "methods": [ + "predict" + ] + } + } + } + } + }, + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "AutoMlGapicClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations" + ] + }, + "ListModels": { + "methods": [ + "listModels" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_client_config.json b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_client_config.json new file mode 100644 index 000000000000..086602a0938f --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.automl.v1.AutoMl": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_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 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 5000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 5000, + "total_timeout_millis": 5000 + } + }, + "methods": { + "CreateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteDataset": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteModel": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ExportData": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ExportModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetAnnotationSpec": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataset": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetModel": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetModelEvaluation": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportData": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListDatasets": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListModelEvaluations": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListModels": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UndeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateModel": { + "timeout_millis": 5000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_descriptor_config.php b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_descriptor_config.php new file mode 100644 index 000000000000..2f2030959022 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_descriptor_config.php @@ -0,0 +1,340 @@ + [ + 'google.cloud.automl.v1.AutoMl' => [ + 'CreateDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AutoMl\V1\Dataset', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AutoMl\V1\Model', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataset' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeployModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UndeployModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAnnotationSpec' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\AnnotationSpec', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataset' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\Dataset', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\Model', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetModelEvaluation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\ModelEvaluation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDatasets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDatasets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\ListDatasetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListModelEvaluations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getModelEvaluation', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\ListModelEvaluationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListModels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getModel', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\ListModelsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDataset' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\Dataset', + 'headerParams' => [ + [ + 'keyName' => 'dataset.name', + 'fieldAccessors' => [ + 'getDataset', + 'getName', + ], + ], + ], + ], + 'UpdateModel' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\Model', + 'headerParams' => [ + [ + 'keyName' => 'model.name', + 'fieldAccessors' => [ + 'getModel', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'annotationSpec' => 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}', + 'dataset' => 'projects/{project}/locations/{location}/datasets/{dataset}', + 'location' => 'projects/{project}/locations/{location}', + 'model' => 'projects/{project}/locations/{location}/models/{model}', + 'modelEvaluation' => 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}', + ], + ], + ], +]; diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_rest_client_config.php b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_rest_client_config.php new file mode 100644 index 000000000000..bbff0ff1693d --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/auto_ml_rest_client_config.php @@ -0,0 +1,389 @@ + [ + 'google.cloud.automl.v1.AutoMl' => [ + 'CreateDataset' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/datasets', + 'body' => 'dataset', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/models', + 'body' => 'model', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataset' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteModel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeployModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:deploy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*}:exportData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:export', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAnnotationSpec' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataset' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetModel' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetModelEvaluation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/datasets/*}:importData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDatasets' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/datasets', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListModelEvaluations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'filter', + ], + ], + 'ListModels' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/models', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UndeployModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:undeploy', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDataset' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{dataset.name=projects/*/locations/*/datasets/*}', + 'body' => 'dataset', + 'placeholders' => [ + 'dataset.name' => [ + 'getters' => [ + 'getDataset', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateModel' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{model.name=projects/*/locations/*/models/*}', + 'body' => 'model', + 'placeholders' => [ + 'model.name' => [ + 'getters' => [ + 'getModel', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/**}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_client_config.json b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_client_config.json new file mode 100644 index 000000000000..be950636b88e --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.automl.v1.PredictionService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_2_codes": [] + }, + "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 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchPredict": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + }, + "Predict": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + } + } + } + } +} diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_descriptor_config.php b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_descriptor_config.php new file mode 100644 index 000000000000..df0456c861c3 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_descriptor_config.php @@ -0,0 +1,62 @@ + [ + 'google.cloud.automl.v1.PredictionService' => [ + 'BatchPredict' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AutoMl\V1\BatchPredictResult', + 'metadataReturnType' => '\Google\Cloud\AutoMl\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'Predict' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AutoMl\V1\PredictResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'model' => 'projects/{project}/locations/{location}/models/{model}', + ], + ], + ], +]; diff --git a/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_rest_client_config.php b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_rest_client_config.php new file mode 100644 index 000000000000..e4707be02c0e --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/src/V1/resources/prediction_service_rest_client_config.php @@ -0,0 +1,195 @@ + [ + 'google.cloud.automl.v1.PredictionService' => [ + 'BatchPredict' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:batchPredict', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'Predict' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/models/*}:predict', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/**}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/AutoMlClientTest.php b/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/AutoMlClientTest.php new file mode 100644 index 000000000000..4596acf3cb67 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/AutoMlClientTest.php @@ -0,0 +1,1982 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AutoMlClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AutoMlClient($options); + } + + /** @test */ + public function createDatasetTest() + { + $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/createDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $exampleCount = 1517063674; + $etag = 'etag3123477'; + $expectedResponse = new Dataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setExampleCount($exampleCount); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataset = new Dataset(); + $request = (new CreateDatasetRequest()) + ->setParent($formattedParent) + ->setDataset($dataset); + $response = $gapicClient->createDataset($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.automl.v1.AutoMl/CreateDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDataset(); + $this->assertProtobufEquals($dataset, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatasetTest'); + $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 createDatasetExceptionTest() + { + $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/createDatasetTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $dataset = new Dataset(); + $request = (new CreateDatasetRequest()) + ->setParent($formattedParent) + ->setDataset($dataset); + $response = $gapicClient->createDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatasetTest'); + 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 createModelTest() + { + $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/createModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $datasetId = 'datasetId-2115646910'; + $etag = 'etag3123477'; + $expectedResponse = new Model(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDatasetId($datasetId); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $model = new Model(); + $request = (new CreateModelRequest()) + ->setParent($formattedParent) + ->setModel($model); + $response = $gapicClient->createModel($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.automl.v1.AutoMl/CreateModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getModel(); + $this->assertProtobufEquals($model, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createModelTest'); + $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 createModelExceptionTest() + { + $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/createModelTest'); + $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->locationName('[PROJECT]', '[LOCATION]'); + $model = new Model(); + $request = (new CreateModelRequest()) + ->setParent($formattedParent) + ->setModel($model); + $response = $gapicClient->createModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createModelTest'); + 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 deleteDatasetTest() + { + $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/deleteDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $request = (new DeleteDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDataset($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.automl.v1.AutoMl/DeleteDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDatasetTest'); + $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 deleteDatasetExceptionTest() + { + $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/deleteDatasetTest'); + $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->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $request = (new DeleteDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDataset($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDatasetTest'); + 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 deleteModelTest() + { + $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/deleteModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new DeleteModelRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteModel($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.automl.v1.AutoMl/DeleteModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteModelTest'); + $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 deleteModelExceptionTest() + { + $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/deleteModelTest'); + $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->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new DeleteModelRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteModelTest'); + 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 deployModelTest() + { + $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/deployModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deployModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new DeployModelRequest()) + ->setName($formattedName); + $response = $gapicClient->deployModel($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.automl.v1.AutoMl/DeployModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployModelTest'); + $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 deployModelExceptionTest() + { + $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/deployModelTest'); + $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->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new DeployModelRequest()) + ->setName($formattedName); + $response = $gapicClient->deployModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deployModelTest'); + 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 exportDataTest() + { + $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/exportDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $outputConfig = new OutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportDataRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportData($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.automl.v1.AutoMl/ExportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + $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 exportDataExceptionTest() + { + $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/exportDataTest'); + $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->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $outputConfig = new OutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportDataRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + 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 exportModelTest() + { + $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/exportModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $outputConfig = new ModelExportOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportModelRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportModel($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.automl.v1.AutoMl/ExportModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportModelTest'); + $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 exportModelExceptionTest() + { + $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/exportModelTest'); + $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->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $outputConfig = new ModelExportOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new ExportModelRequest()) + ->setName($formattedName) + ->setOutputConfig($outputConfig); + $response = $gapicClient->exportModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportModelTest'); + 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 getAnnotationSpecTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $exampleCount = 1517063674; + $expectedResponse = new AnnotationSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setExampleCount($exampleCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); + $request = (new GetAnnotationSpecRequest()) + ->setName($formattedName); + $response = $gapicClient->getAnnotationSpec($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.automl.v1.AutoMl/GetAnnotationSpec', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAnnotationSpecExceptionTest() + { + $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->annotationSpecName('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); + $request = (new GetAnnotationSpecRequest()) + ->setName($formattedName); + try { + $gapicClient->getAnnotationSpec($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 getDatasetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $exampleCount = 1517063674; + $etag = 'etag3123477'; + $expectedResponse = new Dataset(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setExampleCount($exampleCount); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $request = (new GetDatasetRequest()) + ->setName($formattedName); + $response = $gapicClient->getDataset($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.automl.v1.AutoMl/GetDataset', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDatasetExceptionTest() + { + $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->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $request = (new GetDatasetRequest()) + ->setName($formattedName); + try { + $gapicClient->getDataset($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 getModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $datasetId = 'datasetId-2115646910'; + $etag = 'etag3123477'; + $expectedResponse = new Model(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDatasetId($datasetId); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new GetModelRequest()) + ->setName($formattedName); + $response = $gapicClient->getModel($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.automl.v1.AutoMl/GetModel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getModelExceptionTest() + { + $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->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new GetModelRequest()) + ->setName($formattedName); + try { + $gapicClient->getModel($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 getModelEvaluationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $annotationSpecId = 'annotationSpecId60690191'; + $displayName = 'displayName1615086568'; + $evaluatedExampleCount = 277565350; + $expectedResponse = new ModelEvaluation(); + $expectedResponse->setName($name2); + $expectedResponse->setAnnotationSpecId($annotationSpecId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEvaluatedExampleCount($evaluatedExampleCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]'); + $request = (new GetModelEvaluationRequest()) + ->setName($formattedName); + $response = $gapicClient->getModelEvaluation($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.automl.v1.AutoMl/GetModelEvaluation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getModelEvaluationExceptionTest() + { + $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->modelEvaluationName('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]'); + $request = (new GetModelEvaluationRequest()) + ->setName($formattedName); + try { + $gapicClient->getModelEvaluation($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 importDataTest() + { + $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/importDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $inputConfig = new InputConfig(); + $request = (new ImportDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + $response = $gapicClient->importData($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.automl.v1.AutoMl/ImportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + $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 importDataExceptionTest() + { + $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/importDataTest'); + $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->datasetName('[PROJECT]', '[LOCATION]', '[DATASET]'); + $inputConfig = new InputConfig(); + $request = (new ImportDataRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig); + $response = $gapicClient->importData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + 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 listDatasetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $datasetsElement = new Dataset(); + $datasets = [ + $datasetsElement, + ]; + $expectedResponse = new ListDatasetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDatasets($datasets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDatasetsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDatasets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDatasets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ListDatasets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDatasetsExceptionTest() + { + $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 ListDatasetsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDatasets($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 listModelEvaluationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $modelEvaluationElement = new ModelEvaluation(); + $modelEvaluation = [ + $modelEvaluationElement, + ]; + $expectedResponse = new ListModelEvaluationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setModelEvaluation($modelEvaluation); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $filter = 'filter-1274492040'; + $request = (new ListModelEvaluationsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + $response = $gapicClient->listModelEvaluations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getModelEvaluation()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ListModelEvaluations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listModelEvaluationsExceptionTest() + { + $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->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $filter = 'filter-1274492040'; + $request = (new ListModelEvaluationsRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + try { + $gapicClient->listModelEvaluations($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 listModelsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $modelElement = new Model(); + $model = [ + $modelElement, + ]; + $expectedResponse = new ListModelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setModel($model); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListModelsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listModels($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getModel()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.automl.v1.AutoMl/ListModels', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listModelsExceptionTest() + { + $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 ListModelsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listModels($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 undeployModelTest() + { + $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/undeployModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/undeployModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new UndeployModelRequest()) + ->setName($formattedName); + $response = $gapicClient->undeployModel($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.automl.v1.AutoMl/UndeployModel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployModelTest'); + $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 undeployModelExceptionTest() + { + $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/undeployModelTest'); + $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->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $request = (new UndeployModelRequest()) + ->setName($formattedName); + $response = $gapicClient->undeployModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/undeployModelTest'); + 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 updateDatasetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $exampleCount = 1517063674; + $etag = 'etag3123477'; + $expectedResponse = new Dataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setExampleCount($exampleCount); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $dataset = new Dataset(); + $updateMask = new FieldMask(); + $request = (new UpdateDatasetRequest()) + ->setDataset($dataset) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateDataset($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.automl.v1.AutoMl/UpdateDataset', $actualFuncCall); + $actualValue = $actualRequestObject->getDataset(); + $this->assertProtobufEquals($dataset, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDatasetExceptionTest() + { + $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 + $dataset = new Dataset(); + $updateMask = new FieldMask(); + $request = (new UpdateDatasetRequest()) + ->setDataset($dataset) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateDataset($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 updateModelTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $datasetId = 'datasetId-2115646910'; + $etag = 'etag3123477'; + $expectedResponse = new Model(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDatasetId($datasetId); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $model = new Model(); + $updateMask = new FieldMask(); + $request = (new UpdateModelRequest()) + ->setModel($model) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateModel($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.automl.v1.AutoMl/UpdateModel', $actualFuncCall); + $actualValue = $actualRequestObject->getModel(); + $this->assertProtobufEquals($model, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateModelExceptionTest() + { + $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 + $model = new Model(); + $updateMask = new FieldMask(); + $request = (new UpdateModelRequest()) + ->setModel($model) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateModel($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 createDatasetAsyncTest() + { + $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/createDatasetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $exampleCount = 1517063674; + $etag = 'etag3123477'; + $expectedResponse = new Dataset(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setExampleCount($exampleCount); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDatasetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataset = new Dataset(); + $request = (new CreateDatasetRequest()) + ->setParent($formattedParent) + ->setDataset($dataset); + $response = $gapicClient->createDatasetAsync($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.automl.v1.AutoMl/CreateDataset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDataset(); + $this->assertProtobufEquals($dataset, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatasetTest'); + $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/AutoMl/v1/tests/Unit/V1/Client/PredictionServiceClientTest.php b/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/PredictionServiceClientTest.php new file mode 100644 index 000000000000..1baca4b26f48 --- /dev/null +++ b/owl-bot-staging/AutoMl/v1/tests/Unit/V1/Client/PredictionServiceClientTest.php @@ -0,0 +1,370 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PredictionServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PredictionServiceClient($options); + } + + /** @test */ + public function batchPredictTest() + { + $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/batchPredictTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchPredictResult(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchPredictTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $inputConfig = new BatchPredictInputConfig(); + $inputConfigGcsSource = new GcsSource(); + $gcsSourceInputUris = []; + $inputConfigGcsSource->setInputUris($gcsSourceInputUris); + $inputConfig->setGcsSource($inputConfigGcsSource); + $outputConfig = new BatchPredictOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new BatchPredictRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig); + $response = $gapicClient->batchPredict($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.automl.v1.PredictionService/BatchPredict', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchPredictTest'); + $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 batchPredictExceptionTest() + { + $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/batchPredictTest'); + $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->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $inputConfig = new BatchPredictInputConfig(); + $inputConfigGcsSource = new GcsSource(); + $gcsSourceInputUris = []; + $inputConfigGcsSource->setInputUris($gcsSourceInputUris); + $inputConfig->setGcsSource($inputConfigGcsSource); + $outputConfig = new BatchPredictOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new BatchPredictRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig); + $response = $gapicClient->batchPredict($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchPredictTest'); + 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 predictTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new PredictResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $payload = new ExamplePayload(); + $request = (new PredictRequest()) + ->setName($formattedName) + ->setPayload($payload); + $response = $gapicClient->predict($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.automl.v1.PredictionService/Predict', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getPayload(); + $this->assertProtobufEquals($payload, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function predictExceptionTest() + { + $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->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $payload = new ExamplePayload(); + $request = (new PredictRequest()) + ->setName($formattedName) + ->setPayload($payload); + try { + $gapicClient->predict($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 batchPredictAsyncTest() + { + $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/batchPredictTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BatchPredictResult(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/batchPredictTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->modelName('[PROJECT]', '[LOCATION]', '[MODEL]'); + $inputConfig = new BatchPredictInputConfig(); + $inputConfigGcsSource = new GcsSource(); + $gcsSourceInputUris = []; + $inputConfigGcsSource->setInputUris($gcsSourceInputUris); + $inputConfig->setGcsSource($inputConfigGcsSource); + $outputConfig = new BatchPredictOutputConfig(); + $outputConfigGcsDestination = new GcsDestination(); + $gcsDestinationOutputUriPrefix = 'gcsDestinationOutputUriPrefix-335790682'; + $outputConfigGcsDestination->setOutputUriPrefix($gcsDestinationOutputUriPrefix); + $outputConfig->setGcsDestination($outputConfigGcsDestination); + $request = (new BatchPredictRequest()) + ->setName($formattedName) + ->setInputConfig($inputConfig) + ->setOutputConfig($outputConfig); + $response = $gapicClient->batchPredictAsync($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.automl.v1.PredictionService/BatchPredict', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $actualValue = $actualApiRequestObject->getOutputConfig(); + $this->assertProtobufEquals($outputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/batchPredictTest'); + $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()); + } +}